MATLAB Answers


How to send the axes of a GUI to a figure outside the GUI

Asked by Eric
on 19 Apr 2013


I have a GUI with two axes. One displays an image, and the other displays a plot. I am trying to produce a push button for each axes that is allows the user to send the GUI axes to a new figure outside the GUI. I have looked into the copyobj(H,P) and findobj functions,

 H = findobj("GUIFigureName",'type','axes','-not','tag',legend');

This gives me an error "Index exceeds matrix dimensions"... Error in SpecMap>SpecMap_OpeningFcn (line 137) handles.P = varargin{1};

Is there anyway to send my GUI axes to a new figure?

Thank You very much, -Eric



No products are associated with this question.

1 Answer

Answer by per isakson
on 20 Apr 2013
Edited by per isakson
on 20 Apr 2013

Either something like

    H = findobj( 'Name', 'GUIFigureName','type','axes','-not','tag','legend' );


    H = findobj( figure_handle, 'type','axes', '-not','tag','legend' );


Yes, copyobj(H,P) should be the way to do it. An alternative is a bunch of low level get and set on children of H and P, respectively.


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!