필터 지우기
필터 지우기

New arrangement of column and row

조회 수: 1 (최근 30일)
nur yusof
nur yusof 2016년 2월 25일
댓글: Star Strider 2016년 2월 25일
How to rearrange column and row matrix?For example, I have 10x10 matrix size. what I really want to do is
A[1:10,1:10] %original position of column & row matrix size
A2[2 4 6 8 10 1 3 5 7 9,2 4 6 8 10 1 3 5 7 9] %New arrangement of column and row position in matrix
Hope anyone can guide me.Thank you.

채택된 답변

Star Strider
Star Strider 2016년 2월 25일
I’m not certain what you want as your result, but this looks correct to me:
K = randi(99,10)
K2 = K([2 4 6 8 10 1 3 5 7 9]',[2 4 6 8 10 1 3 5 7 9]')
You have to transpose the row and column reference vectors.
  댓글 수: 2
nur yusof
nur yusof 2016년 2월 25일
Thank you....thank you and thank you. It's working.Really appreciate your help.
Star Strider
Star Strider 2016년 2월 25일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

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