sorting one field of struct

files=dir('*.dat');
i want to sort files.name of the files struct by file name

 Réponse acceptée

Walter Roberson
Walter Roberson le 30 Mai 2012

0 votes

[junk, idx] = sort({files.name});
sortedfiles = files(idx);

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by