read value from .m file
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Daniel
le 13 Oct 2022
Réponse apportée : Image Analyst
le 13 Oct 2022
Hi,
I need to read in my text field the values from variables from a .m file.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1154628/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1154633/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1154638/image.png)
For example, I want to read the Temp_R value in my MOT.Temp_R text field and if I change the value in the .m file, the next time I run the app changes too.
Thanks.
Réponse acceptée
Image Analyst
le 13 Oct 2022
No, don't use evalin.
Attach your m-file that sets up (instantiates) your variables. Chances are it's a script that just defines variables and leaves them in the base workspace (so you'd have to use evalin). What you want to do it to turn that m-file into a function that returns the structures as output arguments.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Environment and Settings 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!