Matrix Manipulation Image Processing

2 views (last 30 days)
I have a matrix of 100 rows and 2 columns. How to sort the first column of the matrix and write the corresponding second column elements. Please help me. Its Urgent.Thanks in Advance

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 27 May 2015
A = rand(100,2); % your matrix
[~,ii] = sort(A(:,1));
out = A(ii,:);
  1 Comment
Jes
Jes on 27 May 2015
Thanks a lot. It works. Could you please explain me once . Thanks

Sign in to comment.

More Answers (1)

James Tursa
James Tursa on 27 May 2015
doc sortrows

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!