Path: news.mathworks.com!not-for-mail
From: "Phil Au" <philipawt@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: GUI question
Date: Mon, 18 Feb 2008 01:54:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 66
Message-ID: <fpaofr$ru7$1@fred.mathworks.com>
Reply-To: "Phil Au" <philipawt@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1203299643 28615 172.30.248.38 (18 Feb 2008 01:54:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 18 Feb 2008 01:54:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1283662
Xref: news.mathworks.com comp.soft-sys.matlab:452013


Hi All,

I got an question about my GUI matlab,

If I got two axes, if I want to one of the axes to display 
an img, how can I write it in code, pls,

many thx...

And also when I use the filesparts function, when I press 
the cancelbutton

I get this error~~ 


?? Error using ==> fileparts at 17
Input must be a row vector of characters.

Error in ==> appl>browse_Callback at 143
[pathstr,name,ext,versn] = fileparts(get
(handles.inputimg_ed,'string'));

Error in ==> gui_mainfcn at 96
        feval(varargin{:});

Error in ==> appl at 42
    gui_mainfcn(gui_State, varargin{:});

??? Error while evaluating uicontrol Callback


Can you pls help me to solve it?











Here's my code

function browse_Callback(hObject, eventdata, handles)
% hObject    handle to browse (see GCBO)
% eventdata  reserved - to be defined in a future version 
of MATLAB
% handles    structure with handles and user data (see 
GUIDATA)
[pathstr,name,ext,versn] = fileparts(get
(handles.inputimg_ed,'string'));
if  ~isempty(pathstr),
    pathstr = [pathstr '\'];
end
try
    [file,path] = uigetfile([pathstr '*.jpg'],'Select an 
image');
    set(handles.inputimg_ed,'string',[path file]);
    info = imfinfo([path file]);
    set(handles.width_ed,'string',info.Width);
    set(handles.height_ed,'string',info.Height);
    imshow([path file]);
catch
end