Help with loading data in GUI
显示 更早的评论
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!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!