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: Francesco Potorti`
Subject: Re: extracting rows in a matrix
Date: Wed, 13 May 2009 08:12:28 +0200

> it doesn't work:
>octave:16> extract_row = rand(nrows,1) < 0.2
>extract_row =
>
>   0
>   0
>   0
>   0
>   0
>
>octave:17> B = A(extract_row, :)
>B = [](0x4)

It does work.  You chose nrows=5, which in many cases gives you a choice
of zero rows, as in this particular case.  Try many times with nrows=5,
and look at the results.  Also, try with a bigger nrows.

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/


reply via email to

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