Borrar filtros
Borrar filtros

Using evalin to read .m script

1 visualización (últimos 30 días)
James
James el 17 de Mayo de 2013
I have a .m script already written that reads text files as input. I'm writing a GUI in GUIDE and I want to use a push button to get the values from my .m script. I am assuming that the evalin function is the correct route to go here. But I am unsure exactly how to use it. I am relatively new to MATLAB. How do I store the values from the .m script in 'base' and then call those values from my GUI? Thanks in advance!

Respuesta aceptada

Image Analyst
Image Analyst el 17 de Mayo de 2013
Editada: Image Analyst el 17 de Mayo de 2013
evalin() is not the correct route, or at least not the preferred route. Just put a button on your GUI, view the callback, and paste the code from your m-file into the button's callback. That's what I'd do if the m-file is small enough.
If it's a really long complicated m-file, then I'd just make it a function that returns one of more variables that you can accept when you call it from your button's callback. Like in the callback
[out1, out2, out3] = my_m_file(in1, in2);

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by