|
From: | febty febriani |
Subject: | Re: error in looping |
Date: | Wed, 6 Feb 2013 14:49:16 +0900 |
On 1/28/2013 8:59 PM, febty febriani wrote:A1 to A5 are copied of A first rows
Hi everyone,
My original code like below :
A1=A(:,1);
[a1 index1]=min(abs(A1-10000));
C1=A(index1,:);
A2=A(:,1);
[a2 index2]=min(abs(A2-1000));
C2=A(index2,:);
A3=A(:,1);
[a3 index3]=min(abs(A3-100));
C3=A(index3,:);
A4=A(:,1);
[a4 index4]=min(abs(A4-10));
C4=A(index4,:);
A5=A(:,1);
[a5 index5]=min(abs(A5-1));
C5=A(index5,:);
you are using A for two different objects
C=[C1;C2;C3;C4;C5];
save -ascii $ofile15 C;
I want to make them in a looping. My code code for this purpose is below :
for i=1:5;
A(i)=A(:,1);
Use another identifierRegards
[a(i) index(i)]=min(abs(A(i))-(10^(n-i)));
C(i)=zeros(size(A));
C(i)=A(index(i),:);
end
C=[C1;C2;C3;C4;C5];
save -ascii C.dat C;
However, the error message appeared : error: A(I) = X: X must have the
same size as I.
I have no clue how to fix it. Does anyone can help me? Thanks very much
in advance.
Regards,
Fety
Marco
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |