How to pass data in a gui and refresh/reload a list box
7 views (last 30 days)
hello, I trying to load a mat file into a GUI and then have to user choose the variable in the file in order to pass it into a function. So far, I have managed to load the file using "uigetfile" and then "load" to assign all the variables in the file into a struct variable,and then I got the names of the variables (fields) using "fieldnames".
How can I display those variable names in a list box and assign the one chosen by the user to a new variable and pass it into my function?
thanks in advance I'm not a programmer and I if the solution is too complex odds are that I'll not get it, however if it is simple, I will be thank full for your help.
Rik on 17 Mar 2018
You can set the output from fieldnames as the String property of the listbox. You can use indexing with the Value property in the callback to set it to your variable: