help-octave
[Top][All Lists]
Advanced

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

Re: Piecewise function in octave


From: Carlo de Falco
Subject: Re: Piecewise function in octave
Date: Wed, 15 Oct 2008 22:14:53 +0100


On 15/ott/08, at 21:57, genehacker wrote:

Hi,

I am looking for a code that can specify a function f(t) piecewise, i.e. that can be defined according to intervals based on value of t. I want to
integrate one of these in an anonymous function g(x,t).

f(t) = sin(t)  t<pi
      0         t>=pi

cheers
k3

to implement the example above you could use

f = @(t) sin(t) .* (t<pi) ;

c.



reply via email to

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