Live Script to define a class

30 visualizaciones (últimos 30 días)
CAME18
CAME18 el 24 de Abr. de 2022
Comentada: Samantha May el 7 de Mzo. de 2023
Ever since I discovered Live Editor Scripts, I use them all the time. It is an excellent feature to correctly document a project. Currently it is not possible to define classes in a Live Editor script. Is this functionality under consideration for a future release?
  1 comentario
Matt J
Matt J el 25 de Abr. de 2022
Editada: Matt J el 25 de Abr. de 2022
It would be nice to be able to define classes even in conventional scripts, or other local scopes like functions. I suspect it would be inefficient though. You would need to reinitialize the class every time that local scope was entered.

Iniciar sesión para comentar.

Respuesta aceptada

Prasanna Konyala
Prasanna Konyala el 27 de Abr. de 2022
Hi Camilo
Currently we are not supporting classes in Live Editor. Our developers are aware of this and it might be considered for a future release.
In addition, you can always define classes in normal ".m" files and then use the classes in live scripts or functions.
  2 comentarios
CAME18
CAME18 el 28 de Abr. de 2022
Sure, a class can be defined on a classic .m file. However, the idea is to document, for example, the methods of such a class with the Live Editor's features. I hope it becomes an option on a future release.
Samantha May
Samantha May el 7 de Mzo. de 2023
Hi,
you mentioned:
"you can always define classes in normal ".m" files and then use the classes in live scripts or functions"
How would I go about doing this?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Live Scripts and Functions en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by