how to sort the element of one column in a 220*3 matrix in ascending mode, keeping the elements of other columns dependent on the elements of sorted column ?
Show older comments
i have a 220*3 matrix. the elements of first column in this matrix is related to the elements of other 2 columns. how can i sort the elements of first column in ascending mode, moving the elements of other columns correlated to the elements of first column?
Accepted Answer
More Answers (1)
Jan
on 20 Jul 2015
And this happens inside sortrows:
X = rand(220, 3);
[Y, Order] = sort(X(:, 1));
R = X(Order, :);
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!