sorry, I was looking that way to do it in a loop. They are matrices with same number of columns but different lines.
--- Mer 13/5/09, Przemek Klosowski <address@hidden> ha scritto:
Da: Przemek Klosowski <address@hidden> Oggetto: Re: extracting rows in a matrix A: address@hidden, address@hidden Data: Mercoledì 13 maggio 2009, 16:10
this is better and it's ok thanks. But suppoing I have 4 matrices; and=0Ai = need to pick 1/5 of each of them; and put the result into one matrix;=0Ahow= can I do it with a loop; the name of matrix are: A0, A1, A2, A3. I=0Adon't= know if this name
convenction can help
OK, just do the same thing four times, then:
sz=size(A0,1) tmp0=A0(randperm(sz,:); tmp1=A1(randperm(sz,:); ... result=[tmp0(1:sz/5,:),tmp1(1:sz/5,:)...];
However, given a series of data objects named A0, A1, etc., one wonders if they shouldn't be a single indexed object, either a 3D array or a cell array.
|