필터 지우기
필터 지우기

How can I open csv fille, sort and plot the data from it using GUI?

조회 수: 2 (최근 30일)
Onkar Vader
Onkar Vader 2018년 8월 21일
댓글: Onkar Vader 2018년 8월 24일
I want to open a result CSV file, sort the rows according to one specific column and also plot a graph of two columns using GUI. I need to open the CSV file from different locations, so I also need to create a browse button also. How can I do it?
Thank you for your time and consideration.
  댓글 수: 2
Jan
Jan 2018년 8월 21일
The question is not clear enough. What does e.g. "open the CSV file from different locations" mean? Different servers, hard disks, folders, file names, over the network or on an offline backup drive? What is a "browse button"?

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

채택된 답변

Prem Ankur
Prem Ankur 2018년 8월 23일
편집: Prem Ankur 2018년 8월 23일
Given that you want to browse open '.csv' file from different locations using GUI, I would recommend using App Designer in MATLAB. As Stephen suggested you can use "uigetfile" function for this. Considering your requirements, you can follow these steps:
  • Create an App Designer Project and you can browse open any '.csv' file using
[filename, pathname, filterindex] = uigetfile('*.csv');
csvfile = csvread(fullfile(pathname, filename));
  • You can sort this '.csv' file using "sortrows" function, based on any column. Refer Documentation: https://www.mathworks.com/help/matlab/ref/sortrows.html
  • Then plot the required columns using the "plot" function. Refer Documentation: https://www.mathworks.com/help/matlab/ref/plot.html
Refer to the attached example code for more details regarding implementation.
  댓글 수: 3
Prem Ankur
Prem Ankur 2018년 8월 23일
Thanks Jan, I updated the answer with "fullfile".
Onkar Vader
Onkar Vader 2018년 8월 24일
Thank you Jan and Prem. It helped me a lot.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Application Deployment에 대해 자세히 알아보기

태그

제품


릴리스

R2013b

Community Treasure Hunt

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

Start Hunting!

Translated by