Borrar filtros
Borrar filtros

Return single value from user defined class

4 visualizaciones (últimos 30 días)
M. Mubashir Hussain
M. Mubashir Hussain el 13 de Jun. de 2023
Respondida: Rik el 13 de Jun. de 2023
Hi! I desire to implement my user defined class with a single property on which I perform all operations in the constructor method. When i define class object and try to display it, I get output in the following format:
<class Name> with properties:
<property_name> : value
Is there a way to display the property value directly instead of using: object_name.property_name.
Thanks & Regards.
Mubashir

Respuestas (1)

Rik
Rik el 13 de Jun. de 2023
You can overload disp.
If you always want to interact with the value instead of the object, I don't really see why you would need the wrapper, but you can get very far by overloading all the functions you plan to use.

Categorías

Más información sobre Construct and Work with Object Arrays en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by