Borrar filtros
Borrar filtros

passing parameter values beween a GUI and other scripts

4 visualizaciones (últimos 30 días)
Francois Clemens
Francois Clemens el 30 de Abr. de 2021
Respondida: Saurabh el 14 de Mayo de 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

Respuestas (1)

Saurabh
Saurabh el 14 de Mayo de 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

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by