passing parameter values beween a GUI and other scripts

1 次查看(过去 30 天)
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