필터 지우기
필터 지우기

How to swap columns of matrix zeros(2,n)

조회 수: 1 (최근 30일)
amina shafanejad
amina shafanejad 2015년 4월 22일
댓글: Star Strider 2015년 4월 22일
Hello everyone
I'm working on one project which in need to swap all the columns of the matrix zeros(2,n) which i want to swap the first column with last column, second with second column from last, third column from third column from last and so on can anybody help me with it thank you.
  댓글 수: 2
Jos (10584)
Jos (10584) 2015년 4월 22일
Eh ... swapping two columns filled with zeros has no net effect, or does it?
Star Strider
Star Strider 2015년 4월 22일
@Jos — As is the case with a lot of Questions here, I suspect this is a proxy for a different problem.

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

채택된 답변

Star Strider
Star Strider 2015년 4월 22일
From your description, the fliplr function would work.
  댓글 수: 2
amina shafanejad
amina shafanejad 2015년 4월 22일
thank you
Star Strider
Star Strider 2015년 4월 22일
My pleasure!

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

추가 답변 (1개)

Joseph Cheng
Joseph Cheng 2015년 4월 22일
편집: Joseph Cheng 2015년 4월 22일
well you can achieve this by
test = randi(10,2,10)
hfliptest = test(:,end:-1:1)
i cant remember if there is a built in function to do this. perhaps someone else knows but this should do it.
**edit oh there it is fliplr.
  댓글 수: 1
amina shafanejad
amina shafanejad 2015년 4월 22일
thank you for your response and help i think it will help me

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by