MATLAB: Reading an image from path stored in a text file using IMREAD

image processing

I want to use imread() for reading an image by giving the path stored in a text file, given as input argument. I get an error saying Error in ==> imread at 199 if (strfind(filename, '://'))
WHAT SHALL BE DONE TO GET IT THROUGH?
the code is
fid=fopen('d:/output.txt','r'); data_line = fgetl(fid); data_line [a b] = strread(data_line, '%s %s', 'delimiter', ','); fclose(fid);
% where a and b are the paths i.e d:\pic\image_3.bmp and d:\pic\image_2.bmp
m1 = imread(a); m2 = imread(b);

Best Answer

fid=fopen('d:/output.txt','r');
data_line = textscan('%s%s', 1, 'delimiter', ',');
fclose(fid);
a = data_line{1}{1}; b = data_line{1}{2}; %I think