extracting rows in a matrix

Carlo Rossi serosole at yahoo.it
Wed May 13 09:25:26 CDT 2009


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 <przemek at jazz.ncnr.nist.gov> ha scritto:

Da: Przemek Klosowski <przemek at jazz.ncnr.nist.gov>
Oggetto: Re: extracting rows in a matrix
A: serosole at yahoo.it, help at octave.org
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.



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090513/a3a91978/attachment.html 


More information about the Help-octave mailing list