|
ufellc@gmail.com wrote in message <e62cdfec-2edd-4825-a887-ddbcb676b0f7@j35g2000yqh.googlegroups.com>...
> How would I turn this into a for loop to save the data into 3 separate
> files named CmAhg1, CmAhg2, CmAhg3
> ///////////////////////////////////////////////////
>
> m=0;
> for a=1:1:length(CmAh);
>
> if CmAh(a,1)~=0;
> m=m+1;
> CmAhg1(m,1)=CmAh(a,1);
>
> end
> end
> n=0;
>
> for a=1:1:length(CmAh);
>
> if CmAh(a,2)~=0
> n=n+1;
> CmAhg2(n,1)=CmAh(a,2);
>
> end
> end
> o=0;
> for a=1:1:length(CmAh);
> if CmAh(a,3)~=0
> o=o+1;
> CmAhg3(o,1)=CmAh(a,3);
>
> end
> end
um it is a for loop what's the issue. Of course this just takes out the non zero entries so it could be a one liner
CmAhg1=CmAh(CmAh(:,1)>0,1);
etc
|