Le 25/04/2017 à 15:29, SCHULZ Wolfgang a écrit :
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
halesgroup.com/ump-cnrs-thales
http://www.research.thalesgroup.com
-Message d'origine-
De : users [mailto:users-boun...@lists.scilab.org] De la part de SCHULZ Wolfgang
Envoyé : mardi 25 avril 2017 15:30
À : Users mailing list for Scilab
Objet : [Scilab-users] Problem with Matrix operation
H
Hello,
Le 25/04/2017 à 15:29, SCHULZ Wolfgang a écrit :
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(in
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