function charNos = lineAndColToChar(lineNos, colNos, srcFile)
%LINEANDCOLTOCHAR

%   Copyright 2013-2014 The MathWorks, Inc.

% First generate the map
srcFileContent = fileread(srcFile);
newLineCharNosMap = regexp(srcFileContent, '^.', 'lineanchors');

% Now do the mapping
charNos = cell(size(lineNos));
for i=1:length(lineNos(:))
    charNos{i} = newLineCharNosMap(lineNos{i})+colNos{i}-1;
end

