How to create a struct arrary in the app designer.
Mostra commenti meno recenti
I am creating a GUI in the app designer, and i have several list box and push button, they are all running based of call backs.
My questions are;
How do you save the inputs from the list boxes and push buttons.
How do create an array that save the information of each user without replacing the previous one
How do you link all the apps so that the infomration from each app is saved in the array
9 Commenti
Jan
il 11 Nov 2022
"How do you save the inputs" - saving to a file or to restore the values for the next run?
To create an array, append the new data instead of overwriting them:
S = struct();
for k = 1:5
S(k).value = k;
end
What does "link all the apps" mean?
Nwasinachi
il 11 Nov 2022
Nwasinachi
il 11 Nov 2022
Jan
il 11 Nov 2022
"each time a user interacts with app their answers are saved in a struct array" - for which purpose? The data are stored in the GUI already. Is there a benefit to stored them in a struct in addition?
"is k=1:5 refering to the number of trials? or number of users?" - What is a trial? What is a user? You asked for the creation of a struct array and I've posted an example code to create one. I do not know the project you are working in.
Maybe you are using a non-standard definition of "apps".
Nwasinachi
il 11 Nov 2022
Jan
il 12 Nov 2022
Your questions are welcome and the purpose of my questions for clarifications is to find a solution for your problem. The terminology is as essential as complicated and misunbderstandings are a typical part of finding a solution.
Are you working with a set of different GUIs? Then "apps" might be the correct term.
"how to assign values to list box or radio button" - Actually the values are set by clicking on the controls.
Nwasinachi
il 12 Nov 2022
Jan
il 12 Nov 2022
Maybe it is easier to combine the set of GUIs into one GUI with different tabs.
It is not clear, what "record responses" mean. If you click on a GUI element, its value changes automatically. So afterwards you can request the property "Value".
Until now you have explained the purpose of the code by text only. Then an explicit suggestion for a modification of the code is not possible. Answering would be much easier, if you post the relevant part of the code.
Nwasinachi
il 13 Nov 2022
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Develop Apps Programmatically in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
