MATLAB Answers


How to force GUIHandles to include handles to axes.

Asked by Craig
on 6 Feb 2013

Hello all,

In my GUI start function I do this:

hSpectatorGui = gcf;

And have the start function return hSpectatorGui.

I then call the same GUI from an m s-function and get the handles

handles = guihandles(hSpectatorGui)

The GUI has an edit box and an axes. Guihandles however only returns the handle to the GUI itself and the edit box. The handle to the axes isn't returned!! Something like

       figure1: 4.623009155273438e+003
          edit1: 4.624008911132813e+003

... where is the axes?!

This makes plotting extremely tricky. The tag isn't empty so as far as I can see should work.

Please help!



2 Answers

Answer by Jan Simon
on 6 Feb 2013
 Accepted answer

Do you mean:

handles = guidata(hSpectatorGui)


Answer by Craig
on 7 Feb 2013

Thanks this works. I am trying now to understand the difference between guihandles and guidata!


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!