MATLAB Answers

Logical Indexing with matrix

조회 수: 1(최근 30일)
andrea
andrea 2021년 6월 13일
댓글: andrea 2021년 6월 13일
Helllo,
Assuming I have three matrices:
A = [1 0 ; 0 1]
B = [1 1 ; 1 1]
C = [3 4 ; 6 7]
I would like to perform the following operation
C = C ( A & B ) +1
That is: adding 1 to the elements of the matrix C that meet the condition, but it's not working.
Any ideaa of how to do it ?

채택된 답변

madhan ravi
madhan ravi 2021년 6월 13일
C( A & B ) = C( A & B ) + 1
  댓글 수: 1
andrea
andrea 2021년 6월 13일
Sure, It was trivial..

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

추가 답변(0개)

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by