A= [1, 1, 1, 2, 3, 0, 0, 0];
B= [1, 2, 3 , 3, 3 , 4 , 4, 4];
A is the array I have and I want to arrange it so that A would look like:
A= [3, 2, 1, 1, 1, 0, 0, 0]; OR
A= [3, 2, 0, 0, 0, 1, 1, 1];
The point being that I know (from B) there is 1 unique number at the start, then 1 other unique, then 3 unique and another three unique numbers. If A does not fit that profile then I quit. Is there some Matlab function to handle this kind of sorting?