필터 지우기
필터 지우기

how to reverse matrix?

조회 수: 27 (최근 30일)
eri
eri 2013년 1월 25일
댓글: Tarek Msolli 2020년 11월 19일
i want to reverse the order of row or column, example if i have matrix
2 4 7
7 8 5
it will become(column)
7 4 2
5 8 7
or(row)
7 8 5
2 4 7

답변 (1개)

Image Analyst
Image Analyst 2013년 1월 25일
편집: Image Analyst 2013년 1월 25일
You can use the functions flipud() and fliplr(). Here's the code:
A=[2 4 7
7 8 5]
A_Left_Right = fliplr(A)
A_Up_Down = flipud(A)
In the command window:
A =
2 4 7
7 8 5
A_Left_Right =
7 4 2
5 8 7
A_Up_Down =
7 8 5
2 4 7
  댓글 수: 2
Image Analyst
Image Analyst 2013년 1월 26일
eri, haven't heard back from you - doesn't this do the job?
Tarek Msolli
Tarek Msolli 2020년 11월 19일
some say that he's still waiting for a feedback to this very day, others say he gave up and decided to take his life out for the his never been able to confess his feeling to Eri, but no one is truly sure.

댓글을 달려면 로그인하십시오.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by