I need help with an operation in a Matlab GUI code. I have a folder in my laptop where some files (.dat) are saved , and they are labeled like this '2DVIS_data_08_40fs.dat', '2DVIS_data_08_120fs.dat', '2DVIS_data_08_1320fs.dat' and so on: the only part that changes in their name is the number included between the last underscore '_' and the string 'fs' (40,120,1320…). What I want to do with my code is: 1) save my file in a variable (e.g. 'myfile') by pressing a push button (tag 'push1') and loading it from my folder; 2) show the name of the loaded file (e.g.'2DVIS_data_08_40fs.dat') in an edit text box (tag 'edit1'); 3) show in another edit text box (tag 'edit2') just the part of the string included between the last underscore '_' and 'fs', in this case 40; 4) be able to change the number in this second edit text box (e.g. from 40 to 120) and , with another push button (tag 'push2') load the file which is in the same folder as the previous one but having the number I wrote between the last underscore '_' and the last two letters 'fs' (in this case '2DVIS_data_08_120fs.dat')- of course only if it exists – ; its name should appear in the first edit text box as well ('2DVIS_data_08_120fs.dat'), and should overwrite the previous one in the variable 'myfile'. I really don't know how to do this… thanks!
MATLAB: Help with loading data in GUI
editguiloadmatlab guivariable
Related Question
- Save value from Edit Text box from GUI in a text file and on start load value
- Help with extracting part of a string
- How to extract data from a selected file by pressing a push button in GUI
- How to set a value from code or callback to a edit text box
- Load an image which i choose from a spesific folder
- Importing .txt file into matlab push button
Best Answer