MATLAB Answers


GUI handles does not update

Asked by Naz
on 6 Nov 2011

Hi. Here is a problem: on my gui I have axes where I display an image. At first, my code was as following:


it worked fine so far, however, the word "axes" was underlined by orange line, suggesting that this is not a good way to implement this code. So, I found another way to activate the axis:


now, it works good too, however, something happened to the 'handles' of my GUI - it does not update anymore. Thus, the following:

guidata(hObject, handles);

does not save changes to the handles. I tried to make my GUI active instead of axes, but it did not help:


Is there a way to fix it?



No products are associated with this question.

1 Answer

Answer by Walter Roberson
on 6 Nov 2011
 Accepted answer

Do not use axes() or set CurrentAxes. Instead,

imshow(handles.axes1, myImage)


imshow(myImage, 'Parent', handles.axes1)

  1 Comment

on 6 Nov 2011

The second option works. Thank you Walter.

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!