How to sort uigetfile multiselect data output (cell datas) correctly?
7 views (last 30 days)
Show older comments
Hi, Community
I want to sort filename from uigetfile (multiselect) so that each file would be processed in sequence by that sort later...
Iam creating an uigetfile function like this :
[namafile,arah]=uigetfile({'*.txt', 'Text-Files (*.txt)'},'Load Extraction Data File', 'Multiselect','on');
full_ekstrak = fullfile(arah, namafile); %I dont know where is between these datas that can be used to sort each of filename data
nfiles = numel(full_ekstrak); %I dont know where is between these datas that can be used to sort each of filename data
namafiles_ekstrak = cellstr(sort(namafile)); %I dont know where is between these datas that can be used to sort each of filename data
f = cellstr(fullfile(arah,namafile)); %I dont know where is between these datas that can be used to sort each of filename data
file = length(f); %I dont know where is between these datas that can be used to sort each of filename data
and one of the output variable would be like this (multiselect data) :
namafiles_ekstrak'
ans =
3×1 cell array
{'Komponen Magnet Data Definitif IAGA Menitan (dmin) Periode 01-Nov-2017 Hingga 30-Nov-2017 Stasiun TUN.txt'}
{'Komponen Magnet Data Definitif IAGA Menitan (dmin) Periode 01-Oct-2017 Hingga 31-Oct-2017 Stasiun TUN.txt'}
{'Komponen Magnet Data Definitif IAGA Menitan (dmin) Periode 01-Sep-2017 Hingga 30-Sep-2017 Stasiun TUN.txt'}
Thats Not what i want to get from namafiles_ekstrak variable.
I just want to sort it as ;
{'Komponen Magnet Data Definitif IAGA Menitan (dmin) Periode 01-Sep-2017 Hingga 30-Sep-2017 Stasiun TUN.txt'}
{'Komponen Magnet Data Definitif IAGA Menitan (dmin) Periode 01-Oct-2017 Hingga 31-Oct-2017 Stasiun TUN.txt'}
{'Komponen Magnet Data Definitif IAGA Menitan (dmin) Periode 01-Nov-2017 Hingga 30-Nov-2017 Stasiun TUN.txt'}
So it would be sorted by the datetime IN each of cell output (cell matrix) like that.....
Would it be possible to sort cell matrix like that. I know, maybe its only a small problem and easy, BUT Anyone, please help me in finding this solution that is sooo difficult for me. Iam so grateful if anyone can help me out. Thank you so much /.\ /.\ /.\
0 Comments
Answers (0)
See Also
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!