how can i display the image in GUI??

2 次查看(过去 30 天)
This is my code. To read the image from the file and display that image..m able to read the image but m not able to display it. How do i correct it???
someone plz help me out???
handles.output = hObject;
[fn pn] = uigetfile('*.jpg','select jpg file');
complete = strcat(pn,fn);
set(handles.edit2,'String',complete);
str=get(handles.edit2,'String');
I=imread(str);
figure,imshow(I)

采纳的回答

Walter Roberson
Walter Roberson 2013-2-26
complete = fullfile(pn,fn);
The pathname returned by uigetfile does not necessarily have the directory separator at the end of it.

更多回答(2 个)

Doug Hull
Doug Hull 2013-2-26

sudha
sudha 2013-2-27
ya i got it...Thank you

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by