How to get title for excelwrite code depend on data of specific column
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
hyong suk choo
il 26 Lug 2017
Commentato: hyong suk choo
il 26 Lug 2017
I have 1431770 x 4 array data and there are serial of number in 4th column like
156 456 1 1
564 487 2 1
678 174 3 1
734 157 1 2
478 567 2 2
798 175 1 3
456 756 2 3
645 157 3 3
457 156 4 3
241 475 1 4
......
475 478 157 1800
What I want to ask is, how could I write excel data for each number in 4th column. For example,
156 456 1 1
564 487 2 1
678 174 3 1
for 1.xls,
734 157 1 2
478 567 2 2
for 2.xls
... 1800.xls
0 Commenti
Risposta accettata
Andrei Bobrov
il 26 Lug 2017
Let data - your data [1431770 x 4].
a = accumarray(data(:,4),1);
out = mat2cell(data,a,size(data,2));
for ii = 1:numel(a)
xlswrite(sprint('%d.xlsx',ii),out{ii});
end
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Database Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!