Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Uploading Image...

0 views
Skip to first unread message

Gopinath Koothaperumal

unread,
Dec 31, 2011, 3:02:08 PM12/31/11
to
Good evening everyone...
I having some trouble uploading images onto my axis...its uploading when i run it individually, but not when i run it together....

This is the error :
??? Attempt to reference field of non-structure array.

Error in ==> UploadImage>pushbutton1_Callback at 86
imshow(F, handles.axes1);

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

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

Error in ==>
@(hObject,eventdata)UploadImage('pushbutton1_Callback',hObject,eventdata,guidata(hObject))


??? Error while evaluating uicontrol Callback
------------------------------------------------------------------------------------------------------
My code
[filename, foldername] = uigetfile({'*.jpg;*.tif;*.png;*.gif'});
if filename ~= 0
FileName = fullfile(foldername, filename);
end
F = imread(FileName);
imshow(F, handles.axes1);
------------------------------------------------------------------------------------------------------
Thank u in advance...

ImageAnalyst

unread,
Dec 31, 2011, 4:15:03 PM12/31/11
to
Replace this:
> imshow(F, handles.axes1);
with this
axes(handles.axes1);
imshow(F);

Gopinath Koothaperumal

unread,
Jan 1, 2012, 3:08:08 AM1/1/12
to
ImageAnalyst <imagea...@mailinator.com> wrote in message <1815466f-2574-4a78...@t13g2000yqg.googlegroups.com>...
thank you for the reply....but i did change it...its still the same....
its like this...when i run the (.m) its working)...but not the(.fig file)....

ImageAnalyst

unread,
Jan 1, 2012, 10:02:18 AM1/1/12
to
On Jan 1, 3:08 am, "Gopinath Koothaperumal" <gopichos...@gmail.com>
wrote:
> thank you for the reply....but i did change it...its still the same....
> its like this...when i run the (.m) its working)...but not the(.fig file)....

-------------------------------------------------------
Exactly how are you running the fig file? Are you clicking the green
triangle in GUIDE? If so, that is okay. Are you double clicking the
fig filename in the current folder panel in MATLAB? Don't do that.

Gopinath Koothaperumal

unread,
Jan 1, 2012, 10:51:08 AM1/1/12
to
ImageAnalyst <imagea...@mailinator.com> wrote in message <e4475607-0f62-4b2c...@o9g2000yqa.googlegroups.com>...
owh...actually i was double clicking the current folder panel...my bad...thank u soo much...i tot it wasn't working.

Gopinath Koothaperumal

unread,
Jan 1, 2012, 10:56:08 AM1/1/12
to
oh..okay...no wonder it wasn't working...but i if entered from another gui window, to this particular window...its not working either...it only works if i run it individually

ImageAnalyst

unread,
Jan 1, 2012, 11:16:12 AM1/1/12
to
I don't know what "not working either" means. Does your GUI require
input arguments? Probably not if it runs as a standalone GUI. Your
second GUI can call it if it requires no arguments. If it requires
input arguments then your second GUI should supply those when it calls
it. What does the function line of the first GUI look like? What
does the line that calls your first GUI from your second GUI look like?
0 new messages