%Linearized system
SIGMA = 10;R = 28;BETA = 8/3;x=0;y=1;z=0; A=[-SIGMA, SIGMA, 0; R-z, -1, -x; y, x, -BETA];j=3;dim=3;N=3;[Q,~] = qr(rand(dim,j),0);c = [zeros(1,j-1) 1]; for i=1:N, QNew = A(: ,(i-1)*dim+1:i*dim)*Q; [Q,~] = qr(QNew,0);endQ0=Q;for i = (N+1):(2*N+1), QNew = A(: ,(i-1)*dim +1: i*dim)*Q; [Q,R] = qr(QNew ,0); AllR = horzcat(R,AllR); endnumOfR = size(AllR,2)/j; for i = 1:numOfRR = AllR(: ,(i-1)*j+1:i*j); cNew = R\c;c = cNew/norm(cNew);endw=Q0*c;
I get the error "Index exceeds matrix dimensions.
Error in ginelli (line 21) QNew = A(: ,(i-1)dim+1:idim)*Q;"
Thanks in advance!
Best Answer