How to set AllowEmpty in numeric uieditfield to 'on'
29 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Angus
am 14 Nov. 2023
Kommentiert: Angus
am 22 Nov. 2023
Hi, I've been trying to set a placeholder on a numeric uieditfield and been unsuccessful.
fig=uifigure
xlim=uieditfield(fig, 'numeric');
xlim.AllowEmpty = 'on';
xlim.Value = [];
xlim.Placeholder = 'Input x axis limits';
But this error message appears:
Unrecognized property 'AllowEmpty' for class 'matlab.ui.control.NumericEditField'.
Which is really confusing because the documentation clearly lists that as a property.
Any help is greatly appreciated. Thanks you very much.
3 Kommentare
Akzeptierte Antwort
T.Nikhil kumar
am 22 Nov. 2023
Hello Angus,
I understand that you want to create a placeholder for your numeric edit field but are facing errors with it.
These features of creating a placeholder by leveraging the ‘Placeholder’ property and of allowing empty edit field using the ‘AllowEmpty’ property are additions to the latest release of MATLAB i.e R2023b. Hence, you are facing this error since these properties cannot be accessed in earlier releases.
I would suggest you update your version of MATLAB to R2023b to be able to use these properties.
Hope this helps!
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!