Logical Indexing with matrix

4 vues (au cours des 30 derniers jours)
andrea
andrea le 13 Juin 2021
Commenté : andrea le 13 Juin 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 ?

Réponse acceptée

madhan ravi
madhan ravi le 13 Juin 2021
C( A & B ) = C( A & B ) + 1
  1 commentaire
andrea
andrea le 13 Juin 2021
Sure, It was trivial..

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by