HandleGraphicsSetGet class
Note de l’éditeur : This file was selected as MATLAB Central Pick of the Week
The HGSETGETPLUS class allows the user to:
* Implement a handle class with a get/set interface.
* Define validation criteria for properties that are checked when the
method SET is called.
* Display those criteria for a given property or all the properties.
* Set defaults for the properties.
* Allow a variety of input types in a consistent manner.
Example:
>> h = hgsetgetplusTemplate
h =
hgsetgetplusTemplate handle
Properties:
length: 0
unit: 'm'
Methods, Events, Superclasses
>> set(h)
length: 'double -and- scalar'
unit: '[ {m} | cm ]'
>> set(h,'unit','kg')
??? Error using ==> setOneProperty
Expected kg to match one of these strings:
m, cm
The input, 'kg', did not match any of the valid strings.
------
I would like to thank Jiro Doke for some ideas that got me started and for encouraging me to submit this.
Citation pour cette source
Andrew Newell (2026). HandleGraphicsSetGet class (https://fr.mathworks.com/matlabcentral/fileexchange/30713-handlegraphicssetget-class), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxCatégories
Tags
Remerciements
A inspiré : hgsetgetex: Extension of hgsetget Class (v.2.5)
Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
handleGraphicsSetGet1.0/@hgsetgetplus/
handleGraphicsSetGet1.0/examples/
handleGraphicsSetGet1.0/private/
handleGraphicsSetGet1.0/tests/
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.2.0.0 | Added an acknowledgement |
||
| 1.0.0.0 |
