Azzera filtri
Azzera filtri

Editing a listbox from a GUI

1 visualizzazione (ultimi 30 giorni)
Matthew
Matthew il 10 Giu 2012
Hello,
The program that I am currently working on is a program that analyzes raw data from a series of uv-vis spectroscopy experiments. As the program stands now, the user inputs the raw data into an excel spreadsheet. Then, in the gui the user inputs the name of the excel file and enters information about the reactions (equations, equilibrium constants, etc.). My task for the summer is to update the program to include some new features and to write it in such a way that it is compilable by the Matlab compiler. One of the changes that my professor would like is to have the user input the reaction data in the same excel spreadsheet as the raw data but just on a separate data sheet. He would also like the user to be able to save the results after running the program and optimizing the reactions to another sheet of the excel file. Then, when the user runs the program next, he/she has the the option to use which of the reaction settings to use (say sheets #2 and #3 after running the program once, #2,3 and 4 after running twice, etc.)
My question then is this, as the program is used and the results are saved, I will need a listbox to display the choices of settings. Is there a way to make the listbox "grow" and the options named as the program is run or will I need to choose a maximum number of settings (say 20) and just hope/tell users that they cannot run the program more than that number of times without having to create a new excel file?
Thanks in advance for any help.

Risposta accettata

Walter Roberson
Walter Roberson il 10 Giu 2012
Grow at need. For example,
List = {'one', 'two', 'three'};
h = uicontrol('Style', 'list', 'String', List);
pause(3);
List{end+1} = 'four';
set(h, 'String', List);
pause(3);

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by