read value from .m file

조회 수: 8 (최근 30일)
Daniel
Daniel 2022년 10월 13일
답변: Image Analyst 2022년 10월 13일
Hi,
I need to read in my text field the values from variables from a .m file.
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.
  댓글 수: 1
Daniel
Daniel 2022년 10월 13일
Ok, with evalin().

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2022년 10월 13일
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개)

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by