import data using GUIs
20 次查看(过去 30 天)
显示 更早的评论
Hello gents, I have some data to process in MATLAB, my data are in xlsx files. I want to create a user interface to process this data by first importing it using the same GUI and then plot the results, my question is how to import data using gui?
0 个评论
采纳的回答
Image Analyst
2013-3-24
You might try a listbox arrangement like this: http://www.mathworks.com/matlabcentral/fileexchange/24224. It gives a good GUI framework for starting something like this.
You could fill the listbox with .xlsx files, then when the user clicks on one, it reads it in and plots the results in an axes. You don't have to use image files and display them. You could adapt it to xlsx files and plot them.
0 个评论
更多回答(1 个)
Mahdi
2013-3-25
I would suggest using the uigetfile function and then using the load function by using a pushbutton.
Using GUIDE, make a pushbutton and go to the callback, then type
% This lets you navigate to the file that you want.
[filename, pathname]=uigetfile
Path=stract(pathname,filename)
YourFile=load(Path)
Basically, your data now has the string YourFile in a matrix from the .xslx file.
7 个评论
Mahdi
2013-3-26
Thanks! I had no idea fileparts even exists or the trailing slash issue. That line definitely helps with writing my codes as well and it makes sense!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!