フィルターのクリア

find first value and repalce values following it

1 回表示 (過去 30 日間)
Dam
Dam 2015 年 5 月 5 日
コメント済み: Dam 2015 年 5 月 5 日
Good morning, I have an the following matrix 6*3:
1 1 1
1 1 1
0 1 1
1 1 0
1 1 1
0 0 1
I want to keep the first zero of each colomne and to replace the values that follow it by zeros to get:
1 1 1
1 1 1
0 1 1
0 1 0
0 1 0
0 0 0
Thank you for help bests

採用された回答

Andrei Bobrov
Andrei Bobrov 2015 年 5 月 5 日
A = [1 1 1
1 1 1
0 1 1
1 1 0
1 1 1
0 0 1];
cumprod(A)
  1 件のコメント
Dam
Dam 2015 年 5 月 5 日
Thank you

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by