필터 지우기
필터 지우기

passing parameter values beween a GUI and other scripts

조회 수: 4 (최근 30일)
Francois Clemens
Francois Clemens 2021년 4월 30일
답변: Saurabh 2024년 5월 14일
I'm trying to built a GUI (desigend in appdesigner matlab 2020a) to collectuser input data from a scritp to execute calculations, however it is unclear how to get the user input into the workspace. I did declare the variables to have Access = public:
properties (Access = public)
Roi_cam1;
Roi_cam2;
Roi_cam3;
XY_cam1;
XY_cam2;
XY_cam3;
Cal_cam1; % Description
Cal_cam2;
Cal_cam3;
videoName_cam1;
videoName_cam2;
videoName_cam3;
shape;
disch;
Circ;
Exp_name;
Directory;
end
The matlab documentation is not exactly very clear on the topic of getting data in and out of a GUI. Any help is welcome
kind regards
Francois Clemens

답변 (1개)

Saurabh
Saurabh 2024년 5월 14일
Hi Francois,
It seems like you are trying to export the parameter values between the GUI and another workspace, say the base workspace.
One method that I am aware of is using the ‘assignin’ function, which assigns value to a variable in a specified workspace.
The syntax goes as follows:
assignin(ws,var,val) % assigns the value val to the variable var in the workspace ws.
For example, assignin('base','x',42) assigns the value 42 to the variable x in the MATLAB base workspace.
For more information about the function ‘assignin’ refer to this link:
Regards,
Saurabh

카테고리

Help CenterFile 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!

Translated by