Splitting an array
- From: "Leighton Facey" <tommygarth16k@xxxxxxxxxxx>
- Date: Thu, 7 Jun 2012 11:34:07 +0000 (UTC)
I am attempting to select certain numbers in an array and place them into two different array.
a=[0:1:100]'; for i=1:length(a)
if a(i)>20 a1(i)=a(i);
else
a2(i)=a(i);
end
end
However, matlab in not doing this as a1 still the same size as 'a' and 'a2' is exactly what i want, why not the same with 'a1'?
.
- Follow-Ups:
- Re: Splitting an array
- From: dpb
- Re: Splitting an array
- From: Nasser M. Abbasi
- Re: Splitting an array
- Prev by Date: Re: compile all files from a folder
- Next by Date: Re: how to create an array from known indexes of a matrix
- Previous by thread: matlab over xming super slow
- Next by thread: Re: Splitting an array
- Index(es):