How to modify parameters from a GUI

5 vues (au cours des 30 derniers jours)
Maia
Maia le 18 Déc 2017
Commenté : Stephen23 le 18 Déc 2017
Hi, I have an application with many parameters to set. I managed to modify those parameters with a .m file with struct, e.g. (I have more than 20 parameters to set):
function [params_01,params_02] = define_params()
% first params struct
params_01.value1 = 1;
params_01.value2 = 2;
params_01.value3 = 3;
params_01.value4 = 4;
% second params struct
params_02.value1 = 1;
params_02.value2 = 2;
params_02.value3 = 3;
params_02.value4 = 4;
end
I'd like to be able to load / modify /change /save those parameters within a standalone compiled GUI. I read so far to use *.text file, but it's unclear for me how to use that, I found a video back in 2014, I couldn't find the codes within the video. (https://blogs.mathworks.com/videos/2014/09/29/reading-parameters-from-a-file-in-matlab/)
Thank you for your help.

Réponses (1)

Image Analyst
Image Analyst le 18 Déc 2017
Simply call
[params_01, params_02] = define_params()
in your GUI code somewhere. If you want those variables to be available in a function other than the one you call define_params() from, then see this link for info on how to expose the variables to other functions.

Catégories

En savoir plus sur Data Import and Export dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by