Fill one vector with zeros when another vector is zero

2 vues (au cours des 30 derniers jours)
Francisco Anaya
Francisco Anaya le 26 Mar 2019
Commenté : Francisco Anaya le 26 Mar 2019
I have two vectors A and B of same lengths. I wanto to replace values of A with zeros when B is 0. As follows:
[A] [B]
1 1
2 1
3 1
4 0
5 0
6 1
7 1
8 0
Then the new [A] will be...
[A2]
1
2
3
0
0
6
7
0
Any help will be much apreciated it.

Réponse acceptée

madhan ravi
madhan ravi le 26 Mar 2019
Modifié(e) : madhan ravi le 26 Mar 2019
  5 commentaires
madhan ravi
madhan ravi le 26 Mar 2019
Modifié(e) : madhan ravi le 26 Mar 2019
Francisco Anaya
Francisco Anaya le 26 Mar 2019
Thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by