Fill one vector with zeros when another vector is zero

1 回表示 (過去 30 日間)
Francisco Anaya
Francisco Anaya 2019 年 3 月 26 日
コメント済み: Francisco Anaya 2019 年 3 月 26 日
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.

採用された回答

madhan ravi
madhan ravi 2019 年 3 月 26 日
編集済み: madhan ravi 2019 年 3 月 26 日
  5 件のコメント
madhan ravi
madhan ravi 2019 年 3 月 26 日
編集済み: madhan ravi 2019 年 3 月 26 日
Francisco Anaya
Francisco Anaya 2019 年 3 月 26 日
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by