Azzera filtri
Azzera filtri

Trying to create bode plot on a uitab() causes error

4 visualizzazioni (ultimi 30 giorni)
I use the uitab and uitabgroup() function for organizing lots of plots into tabs and subtabs. The issue is that bode and frequency-response plots don't work with them.
This is how you'd normally create a tab and plot on it:
figure()
th = uitab('Title','Tab 1');
axes('Parent',th);
plot(rand(10,3))
Doing the same for a bode plot would look like this:
figure()
th = uitab('Title','Tab 1');
ah = axes('Parent',th);
bode(tf(1,[1 1]))
The problem is this generates the following error:
Error using DynamicSystem/bode (line 96)
The name 'Visible' is not an accessible property for an instance of class
'matlab.ui.container.Tab'.
There are heavy-handed ways of creating bode plots in new figures and then copying them over to the tab but that only partly works. Is there any way around this issue? Maybe a way to add the 'Visible' property to the Tab class?

Risposta accettata

William Graves
William Graves il 11 Gen 2017
Modificato: William Graves il 11 Gen 2017
I actually just solved this myself. While bode plots don't like being placed on uitab, they're fine when put on uipanels. The solution is to place a uipanel on the uitab and then create the bode plot on the uipanel.
figure()
th = uitab();
u = uipanel('Parent',th);
axes('Parent',u)
bode(tf(1,[1 1]))
I'd still consider the initial issue a bug that should be fixed by MathWorks. In the meantime, this workaround isn't too bad.

Più risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by