VERY simple question about adding 2 matrices

1 回表示 (過去 30 日間)
Mohsen
Mohsen 2014 年 3 月 17 日
コメント済み: Mohsen 2014 年 3 月 17 日
Matrix A and B have the same size: 512 x 512 x 105.
I want each element of matrix A to be equal to the corresponding element in matrix B when that element in matrix B is greater than zero.
How can I write this without a for loop?
Thank you very much!!

採用された回答

Walter Roberson
Walter Roberson 2014 年 3 月 17 日
A(B>0) = B(B>0);
  1 件のコメント
Mohsen
Mohsen 2014 年 3 月 17 日
Thanks a lot!! :)

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by