필터 지우기
필터 지우기

How to arrange ascending order only one column of a matrix?

조회 수: 3 (최근 30일)
Arnab Pal
Arnab Pal 2018년 2월 15일
답변: Andrei Bobrov 2018년 2월 15일
Let's say, I have a=[25 10 85 35 71; 1 2 3 4 5] and output shout come b=[10 25 35 71 85; 2 1 4 5 3]

채택된 답변

Birdman
Birdman 2018년 2월 15일
b=sortrows(a.').'

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2018년 2월 15일
[~,ii] = sort(a(1,:));
out = a(:,ii);

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by