help-octave
[Top][All Lists]
Advanced

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

RE: Qustion about data range selection


From: Klaartje en Mathieu Melenhorst
Subject: RE: Qustion about data range selection
Date: Sat, 7 Jan 2012 19:04:37 +0000

Dear Jordi,


Thank you very much for the very fast answer!
Regards, Mathieu

> Date: Sat, 7 Jan 2012 13:28:47 -0500
> Subject: Re: Qustion about data range selection
> From: address@hidden
> To: address@hidden
> CC: address@hidden
>
> On 7 January 2012 13:08, Klaartje en Mathieu Melenhorst
> <address@hidden> wrote:
> > In MathCad I used the boolean "if" to change a mathematic operation,
> > depending on the input data.
> >
> > t:=0,(pi/100)..4pi
> >
> > y(t):=|sin(t) if t<=2pi
> >          |cos(t) if t>2pi
> >
> >
> > How can this be implemented in Octave?
>
> Use the ifelse command:
>
> t = linspace(0, 4*pi, 100);
> y = ifelse(t <= 2*pi, sin(t), cos(t))
>
> HTH,
> - Jordi G. H.

reply via email to

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