How to get groot before R2014b?

I am working on a GUI program. groot was used in the scripts.
However, when applying it I found some old computers installed older version of Matlab, which made the GUI down.
I was thinking of define a variable groot to make the GUI working if matlab version was older than R2014b, by verLessThan.
How should I do it?

6 comentarios

Star Strider
Star Strider el 13 de Dic. de 2019
If I remember correctly, prior to R2014b, the default setting was 0.
Setting:
groot = 0;
may work.
Albert Bing
Albert Bing el 13 de Dic. de 2019
Tried in a newer matlab, it didn't work.
h = figure();
uicontrol(0, 'style','text', 'String','text', 'position',[10,10,30,20]);
I might try it in older machine next week since I don't have that now.
Thanks anyway.
Star Strider
Star Strider el 13 de Dic. de 2019
I doubt if it would work in R2014b and later releases.
I believe it is only used to set the default properties, as is groot. (I have not needed to do that in a long time.)
Steven Lord
Steven Lord el 13 de Dic. de 2019
I don't think that specific uicontrol command should work in any MATLAB release. uicontrol objects can't be parented to the root graphics object. The error message I receive in release R2019b should probably be similar to the one you received in the older release:
"Parent must be a Figure or UITab or any UIContainer"
Change that 0 to h, the figure you created on the previous line.
Walter Roberson
Walter Roberson el 13 de Dic. de 2019
Sometimes groot is useful to provide a starting point for findall or findobj especially with a -depth argument (the starting point is not formally defined if you omit the object reference.)
Albert Bing
Albert Bing el 14 de Dic. de 2019
Reply to @Steven Lord's comment, I used uicontrol(0, ...) just to replace groot to 0.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 13 de Dic. de 2019

Comentada:

el 14 de Dic. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by