Hi everyone.
Ive got this array, its a {1,3} cell array, the first array in the cell is an [Inf;Inf] vector, the second array is [1;1], and the third array is a 2×6 matrix
The thing is, first i want to sort this array by size, so i have this code
[~,I] = sort(cellfun('size',Basins,2),'ascend');Basins = Basins(I)
and it returns the cell sorted by columns size, as desired.
But then, for the case where ive got columns with the same size ([Inf;Inf] and [1;1]) i want to sort just those 2 columns by the sum of absolute values
so, if my cell array is {[2×6],[1,1],[Inf;inf]} after the first sort it would be {[Inf;inf],[1,1],[2×6]} but then, i would like to sort it so it gives me {[1,1],[Inf;inf],[2×6]}
Thanks in advance 🙂
Best Answer