Hey guys, thanks in advance for any responses. I've been working on a series of GUIs that allow the user to control a stepper motor as a function of another motor's RPM and have had quite a bit of success. The current functionality I'm trying to add to the software is the ability for the user to define their own function of control, which would create a file with a name they've chosen, add a string to the listbox with the description they've chosen, and add the functionality to the code. I've run into an error in this bit because I can't seem to think of the best way to do it, I've thought about storing all the data in cells and referencing them, or writing them to a file, or trying to use structs, but I could really use some input. I'll attach some code for a better description below.
User hits "add new function" button which calls the first in a series of 4 GUIs that define fileName, functionName, functionActual, and creates the file corresponding to their function (in a sub folder) using getappdata/setappdata to transfer data between GUIs.
The main GUI has to see which function they've selected after a toggle button is pushed and call that specific file for an feval() code, which I've been doing like this ('Normal0F' is the file name):
functionCall = 'Normal0F';
functionCall = 'Lateral0F';
functionCall = 'Normal5A';
So this code needs to update with another case that corresponds to the next value. I thought about using functionList = what(<subfolder dir>); functionList.m to make some sort of array containing the file names, but the function call names (listbox) have to correspond to the right file names which the OS may send back in ABC order, or date modified, depending on how the folder is set up.
THANKS A MILLION! Looking forward to your input.