필터 지우기
필터 지우기

how to get the data from edit box of GUI and use in other .m file

조회 수: 1 (최근 30일)
madhu T S
madhu T S 2015년 5월 8일
편집: Stephen23 2015년 5월 18일
Hello ppl... I want to know that how to use the data or value in the edit box of the GUI and I want to use the same data in some other .m file.. please let me know asap
thanks and regards madhu

채택된 답변

Image Analyst
Image Analyst 2015년 5월 8일
Use get():
myVar = get(handleToEditBox, 'String');
Then you can save it to a mat file with save
save(matFullFileName, 'myVar');
that the other m-file can read in with load(matFullFileName).

추가 답변 (1개)

CAM
CAM 2015년 5월 8일
To supplement the above answer:
Add str2num if it is a value, so you get the correct datatype.
myVar = str2num(get(handleToEditBox, 'String'));
If the file already exists, add the "-append" switch to the save statement
save(matFullFileName, 'myVar', '-append')
Hope that helps.
  댓글 수: 2
madhu T S
madhu T S 2015년 5월 18일
Hello CAM, I'm able to save the data... but though it have default filename, everytime a popup window is coming while saving the mat file... as in the below image how to avoid it??? Im using follwing code
uisave({'RsT','LsgsT','LmT','Vrat','Irat','frat','nrat','cosphi','Prat'},'AD_motor_data');
Stephen23
Stephen23 2015년 5월 18일
편집: Stephen23 2015년 5월 18일
uisave always creates a User Interface. That is why it is called *UI*save. If you do not want the UI, then simply use save instead.

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

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by