help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extracting rows in a matrix


From: Przemek Klosowski
Subject: Re: extracting rows in a matrix
Date: Wed, 13 May 2009 10:10:45 -0400 (EDT)

   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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]