how to replace elements of a matrix position wise?????

조회 수: 2 (최근 30일)
suchismita
suchismita 2014년 6월 23일
댓글: suchismita 2014년 6월 23일
I have a matrix: A=[1 1 0 1; 1 0 1 1; 1 0 0 0; 0 1 0 1] now the elements of 3rd and 4th column i want to change every element as if its 1 than 0 or if its 0 than 1.
please please help me.....

채택된 답변

Dishant Arora
Dishant Arora 2014년 6월 23일
A(:,3:4)=~A(:,3:4)
  댓글 수: 3
Dishant Arora
Dishant Arora 2014년 6월 23일
A(:,[1,4]) = ~A(:,[1,4])
suchismita
suchismita 2014년 6월 23일
thank you so much

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

추가 답변 (0개)

카테고리

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