How can I sort Images ?
13 views (last 30 days)
I have a vector
And I have several frames from a video. Ex.
What I want is to "attach" each frame to each element from norma vector, and then sort the images, by sorting norma vector in ascending way.
How can I do this ?
Thanks in advance !!
Guillaume on 1 May 2015
Edited: Guillaume on 1 May 2015
Use the second return value of sort to reorder the 4th dimension of your pill array. In your particular example:
norma = [1.087,0.047,0,0.35];
[sortednorma, order] = sort(norma);
pill(:, :, :, 48:51) = pill(:, :, :, 47 + order);
%obviously, if norma is the same length as the 4th dimension of pill, it's simply:
%pill = pill(:, :, :, order);
edit: fixed a typo