2014-04-23 37 views
-2

我想打开一个目录,以便可以选择任何图像,然后使用imread读取它。Matlab - 如何从目录读取图像

I have tried this: 

[FileName,PathName] = uigetfile('*.jpg','Select the image file'); 
i=imread ([FileName,PathName]); 

但是我在目录中选择IMG3,我得到的错误:

"img3.jpg does not exist" 

谁能告诉我如何做到这一点?

回答

1

检查[FileName,PathName]的输出,这不是一个合适的文件名。使用fullfile来concatinate PathNameFileName