Load a variable from base workspace into a edittext field
이전 댓글 표시
I have a a function called DataCollector.m The function opens the file explorer using
[FileName,PathName] = uigetfile('*.lcm','Select the MATLAB code file');
Which is in the DataCollector.m file.
So i would like to take the parameter FileName and display it in a edit text field. So i have written
app.EditField.Value = FileName;
Which does not work. How do i solve this?
댓글 수: 2
Jan
2018년 2월 16일
Please explain "does not work" with any details. How could the readers suggest a solution, if they do not know, what's going wrong?
adnan Hossain
2018년 2월 16일
채택된 답변
추가 답변 (1개)
Stephen23
2018년 2월 16일
Define the function so that FileName is an input argument:
function DataCollector(FileName)
...
app.EditField.Value = FileName;
...
end
and then simply call it with whatever value you want:
DataCollector('MyFile')
카테고리
도움말 센터 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!