I have created my own LiveTask (a simple UI for file and folder selection plus manipulation) for others to use in a livescript but I want to use it personally as an object that I call from a regular M-file.
I can call it directly and it fires up and all the interaction works etc and I can call the generateCode() method but how can I get the calculated values into my workspace?
Technically, I could probably put a call to "assignin" within my task or fiddle with some "eval" calls to process the generated code but I would like to try and keep my code clean and more "Matlab".

2 comentarios

Martin Dale
Martin Dale el 6 de Jul. de 2026
Thanks Stephen, that uiwait/uiresume process works a treat.

Iniciar sesión para comentar.

 Respuesta aceptada

dpb
dpb el 2 de Jul. de 2026
Editada: dpb el 2 de Jul. de 2026

0 votos

It must be a function (not a script) and have defined return variables to return them with ordinary function syntax. If will also then have to be constructed such that the top level function assigns the results from whatever functions it calls so they're in scope to be able to be assigned to the return variable(s) passed back to its caller (your m-file function or command line).
Failing that, it would take indirect transfer of one form or another, yes.

1 comentario

Martin Dale
Martin Dale el 3 de Jul. de 2026
I get that only functions can return values but this is the case of an object (matlab.task.LiveTask) that includes a uifigure and various uicontrols. I suppose the real question is whether callback functions (eg. CloseRequestFcn) can return a value that I can continue to use after the handle to the Livetask object has been deleted?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Centro de ayuda y File Exchange.

Productos

Versión

R2025b

Etiquetas

Preguntada:

el 2 de Jul. de 2026

Comentada:

el 6 de Jul. de 2026

Community Treasure Hunt

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

Start Hunting!

Translated by