For uicontrol, why can't "UserData" property hold a structure but 'UserData' can?
Mostra commenti meno recenti
While converting code in 2018b to use strings as much as possible, ran into this surprising error:
f = figure;
s.a = 1;
uicontrol(f, "String", "Hello", "UserData", s);
The error is "Incorrect number of input arguments". However, the following do not generate errors:
uicontrol(f, "String", "Hello", 'UserData', s);
or
a = 1;
uicontrol(f, "String", "Hello", "UserData", a);
It seems that UserData as a string when naming the property and giving it a structure causes the trouble.
Any thoughts out there?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Software Development in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!