[filename, pathname] = uigetfile(... {'*.jpg; *.JPG; *.jpeg; *.JPEG; *.img; *.IMG; *.tif; *.TIF; *.tiff, *.TIFF','Supported Files (*.jpg,*.img,*.tiff,)'; ... '*.jpg','jpg Files (*.jpg)';... '*.JPG','JPG Files (*.JPG)';... '*.jpeg','jpeg Files (*.jpeg)';... '*.JPEG','JPEG Files (*.JPEG)';... '*.img','img Files (*.img)';... '*.IMG','IMG Files (*.IMG)';... '*.tif','tif Files (*.tif)';... '*.TIF','TIF Files (*.TIF)';... '*.tiff','tiff Files (*.tiff)';... '*.TIFF','TIFF Files (*.TIFF)'},... 'MultiSelect', 'on'); % Error check - if no filename there is an error if isequal(filename,0) error(' Load Error: No files selected! Load cancelled.') else end % launch the figure box figure imagefilename = imgfile(filename,pathname); c = imread(imagefilename); image(c) axis image grid on
I'm certain the problem is the bit after I launch the figure, but I have tried several different combinations of syntax, but just cant get it right.
I think you want fullfile() instead of imgfile().
% Have user browse for a file, from a specified "starting folder." % For convenience in browsing, set a starting folder from which to browse. startingFolder = 'C:\Program Files\MATLAB'; if ~exist(startingFolder, 'dir') % If that folder doesn't exist, just start in the current folder. startingFolder = pwd; end % Get the name of the file that the user wants to use. defaultFileName = fullfile(startingFolder, '*.*'); [baseFileName, folder] = uigetfile(defaultFileName, 'Select a file'); if baseFileName == 0 % User clicked the Cancel button. return; end fullFileName = fullfile(folder, baseFileName) myImage = imread(fullFileName); imshow(myImage);
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.