how to plot or put the function ( wvtool ) in my gui axis1

greetings for everybody
please i would like to know how to put that function ( wvtool ) in my GUI interface
as example i will put this code in any pushbottom and will show it in my GUI axis1 ??
L = 64;
wvtool(hamming(L))
thanks for reading

 Accepted Answer

No, you cannot do that. wvtool() is a GUI with a toolbar and multiple axes of plots. In MATLAB, it is not possible for a GUI to be contained within an axes. GUIs that do not have toolbars can be placed inside uipanel, but not inside an axes.
You could record the figure handle returned from wvtool() and locate the axes inside the figure and move them to a container object in your original figure. The container objects that can contain axes are uipanel, hggroup, or hgtransform. One axes cannot contain another.

4 Comments

i didn't get your explanation that i can record the figure ? can make make short example
thanks
%we cannot move the axes of a wvtool into an axes, but we can
%find the parent container of the axes and move the wvtool
%objects into there
parent_container = ancestor(axis1, {'hgtransform','hggroup','uipanel', 'uitab', 'figure'});
%now create the wvtool
wvfigh = wvtool(hamming(L));
%locate the axes in the generated wvtool
wvfigax = findall(wvfigh, 'type', 'axes');
%and move them into the parent container we located
set(wvfigax, 'Parent', parent_container);
%and now get rid of the empty wvtool
delete(wvfigh)
thanks for fast replay but the axis1 undefined ?
Before the code insert
axis1 = findobj(0,'tag','axis1');

Sign in to comment.

More Answers (0)

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!