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

3 次查看(过去 30 天)
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
a(a==0)=1; % done!
Look up "matrix addressing" in documentation

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by