Comparing the two matrices

H is my matrix with 18*36 and there is another position matrix defining the position of one's in H matrix let say B. Now i have another new matrix let say L of same size with H matrix filled of integers So,I need to assign the value of L in the position of ones's in H matrix

1 件のコメント

James Tursa
James Tursa 2015 年 9 月 15 日
編集済み: James Tursa 2015 年 9 月 16 日
Please clarify what B contains. Is it the same size as H? Does it contain index numbers? Or what? A short example would help.

回答 (1 件)

James Tursa
James Tursa 2015 年 9 月 15 日

0 投票

Not sure what B is. But if you want to replace the 1's in H with numbers from L, then
x = (H == 1);
H(x) = L(x);

この質問は閉じられています。

質問済み:

2015 年 9 月 15 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by