[Scilab-users] help, please
Tamás Reiter
reitertamas at gmail.com
Thu Feb 20 09:57:42 CET 2014
Hi all,
I would appreciate if anyone could suggest a solution for extracting the
content of a column vector to a pre-defined matrix size (identical row
numbers) within a for loop. I keep getting an error message:Submatrix
incorrecly defined...
my loop is as follows:
for j=1:numpcs do
t=X(:,1);//pick the score vector (first column of X)
t_pre=t-t;
while norm(t-t_pre) > threshold do
p=(X'*t)/norm(X'*t);//calculate and normalise the loading vector
t_pre=t;//saving the original vector into t_pre
t=X*p;//calculating the new score vector (product of eigenvalue and
eigenvector)
end
//extracting components explored
X=X-t*p';//calculating the residual matrix
*T(:,j)=t(:,:);--THIS IS WHERE I AM GETTING THIS ERRORP(:,j)=p(:,:);--THIS
IS WHERE I AM GETTING THIS ERROR*end
//T(:,j+1:numpcs)=[];
//P(:,j+1:numpcs)=[];
S=diag(T'*T);
Very much appriciate any help,
Kind regards,
Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20140220/945017e3/attachment.htm>
More information about the users
mailing list