Filter löschen
Filter löschen

passing parameter values beween a GUI and other scripts

4 Ansichten (letzte 30 Tage)
Francois Clemens
Francois Clemens am 30 Apr. 2021
Beantwortet: Saurabh am 14 Mai 2024
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

Antworten (1)

Saurabh
Saurabh am 14 Mai 2024
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

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by