Hi everyone. I was confused about the order in 'uigetfile'. When I use this commend to open multiple files, like: filename = uigetfile('*.mat', 'Pick a file', 'MultiSelect', 'on'); maybe more than 100 files. And I use these data to build a matrix and then to plot a figure. Then in this figure I found that maybe one of my data is specific and I need to pick it out. But all I know is which row this data in my matrix but can't match it to the data in my file cause I don't know the order of opening the data.Is there anyone could help me? Thanks

댓글 수: 3

Geoff Hayes
Geoff Hayes 2018년 7월 13일
Zhang - can't you keep the list of files that uigetfile has returned to you? Presumably row k of your matrix will correspond to the kth file in that file list...
Zhang Shiming
Zhang Shiming 2018년 7월 13일
Actually I found that the order in matrix doesn't match it in files. For example, I found the 9th data is what I need, but the 9th data in file doesn't match the 9th row in matrix. That's the matter.
Walter Roberson
Walter Roberson 2018년 7월 13일
You do not tell us about how you create rows of your matrix from your input files.

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

 채택된 답변

Stephen23
Stephen23 2018년 7월 13일
편집: Stephen23 2018년 7월 15일

0 개 추천

The uigetfile help states that "File names in the cell array are sorted in the order that that the user's platform uses", which is basically undefined for Windows. You could download and sort the filenames using my FEX submission nastsortfiles:

댓글 수: 1

Zhang Shiming
Zhang Shiming 2018년 7월 18일
Thanks for your answer.My solution is save the filename() as a .mat file and when I got some troubles of data, just check the filename I saved. A little bit inconvenient, but works.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

질문:

2018년 7월 13일

댓글:

2018년 7월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by