help-octave
[Top][All Lists]
Advanced

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

Re: Oct-file version of x>0


From: Dmitri A. Sergatskov
Subject: Re: Oct-file version of x>0
Date: Tue, 23 May 2006 20:39:27 -0600

On 5/23/06, Keith Goodman <address@hidden> wrote:
While porting a m-file to an oct-file I got stuck on the line

y = x'*(x > 0);

where x is Nx1.

How do I port x>0?


I cannot help you with your oct file, but the expression gets
parsed correctly on octave 2.9.5:

octave:1> x=rand(10,1)
x =

 0.323223
 0.372934
 0.021102
 0.876365
 0.498951
 0.183033
 0.863289
 0.186314
 0.469338
 0.622294

octave:2> y = x'*(x > 0)
y = 4.4168

Regards,
Dmitri.
--



reply via email to

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