Effacer les filtres
Effacer les filtres

Using evalin to read .m script

1 vue (au cours des 30 derniers jours)
James
James le 17 Mai 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!

Réponse acceptée

Image Analyst
Image Analyst le 17 Mai 2013
Modifié(e) : Image Analyst le 17 Mai 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);

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by