import data using GUIs

조회 수: 12 (최근 30일)
Zine
Zine 2013년 3월 24일
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?

채택된 답변

Image Analyst
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.

추가 답변 (1개)

Mahdi
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
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!
Zine
Zine 2013년 3월 26일
Thanks very much gents, your discussion was very very helpful for me and I can set my question to solved, even it answers some other questions about the subject that I wanted to ask later, your answers are both accepted and I will tick them if possible

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by