Info

This question is closed. Reopen it to edit or answer.

How do I get the filename of an image that I loaded and store it in a string variable?

1 view (last 30 days)
this is the code I used to load the image
global im im2
[path,user_cance]=imgetfile();
im=imread(path);
Is there a way that I can get the filename of the image, say for example 'imgname.bmp', store it in a string variable say 'string sname' and then
strcmp(sname,'imgname.bmp');
if true
statement1
else
statement2
end
How can I do this or is there any other way?I am a beginner so please be elaborate. Thank you in Advance.

Answers (0)

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!