question of 'uigetfile' command order

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 comentarios

Geoff Hayes
Geoff Hayes el 13 de Jul. de 2018
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 el 13 de Jul. de 2018
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 el 13 de Jul. de 2018
You do not tell us about how you create rows of your matrix from your input files.

Iniciar sesión para comentar.

 Respuesta aceptada

Stephen23
Stephen23 el 13 de Jul. de 2018
Editada: Stephen23 el 15 de Jul. de 2018

0 votos

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 comentario

Zhang Shiming
Zhang Shiming el 18 de Jul. de 2018
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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre App Building en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 13 de Jul. de 2018

Comentada:

el 18 de Jul. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by