Hello,
I want to set certain elements of a matrix to 1. Interestingly the following 
code fills 9 elements with 1. I expected to have only 3 elements (with index 
1,1; 2,2 and 3,3) filled with 1.

A=zeros(5,3)
inx=[1 2 3];
iny=[1 2 3];
A(inx,iny)=1

Is there any way to fill a matrix with 1 where I have the indexes in 2 vectors?

Thanks for your help
Wolfgang
_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to