I am working on a coding project and ran into a roadblock. I have a cell array of 1x3 matrices. (1,1) encodes the value to sort by, (1,2) and (1,3) encode coordinates that i need for reference later. Is there any way to sort the cell array by the (1,1) values in each matrix within the larger cell array?
CombList = {[1,1,1], [5,1,2];
[4,1,3], [3,1,2];
[2,1,4], [2,1,3]};
I would like to sort by the first values in each matrix within the cell array. Ideally, it would return:
CombList = [1,1,1], [2,1,3];
[2,1,4], [3,1,2];
[4,1,3], [5,1,2]};
...once sorted:)
Thank you!
n by 3
matrix or anm by 6
? Any sorting would basically require to make it a double matrix anyways. – Oleg