Logical Indexing with matrix

4 views (last 30 days)
andrea
andrea on 13 Jun 2021
Commented: andrea on 13 Jun 2021
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 ?

Accepted Answer

madhan ravi
madhan ravi on 13 Jun 2021
C( A & B ) = C( A & B ) + 1

More Answers (0)

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!