extracting rows in a matrix

Przemek Klosowski przemek at jazz.ncnr.nist.gov
Wed May 13 09:10:45 CDT 2009


   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.


More information about the Help-octave mailing list