Sorting structure with vector field
Mostra commenti meno recenti
I want to sort a field structure that is a vector field. You can see in the image.
I tried the following method but it doesn't works.
D=struct2cell(A) tam=size(D) D = reshape(D, tam(1), []) D=D' D=sortrows(D,1)
when I do the last command matlab error message apears:
Error using sortrows>sort_cell_back_to_front (line 130) Some cells in X contain non-scalar values and cannot be sorted.
Error in sortrows (line 88) ndx = sort_cell_back_to_front(x_sub, col);
I think it's because the first field is a vector field of type double.
How can I solve this?
Thanks in advance.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Install Products in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!