Assign values to a matrix from a 2 dimensional array....

Think I have a 2-dimensional array(Assume that x and y co-ordinations). And I want to assign '1' to all those co-ordinations given in the array(If the matrix values all are Zeros). How to do that Task ?

 採用された回答

dpb
dpb 2017 年 4 月 2 日

0 投票

a(a==0)=1; % done!
Look up "matrix addressing" in documentation

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

質問済み:

2017 年 4 月 2 日

回答済み:

dpb
2017 年 4 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by