help-octave
[Top][All Lists]
Advanced

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

Re: Piecewise function in octave


From: genehacker
Subject: Re: Piecewise function in octave
Date: Wed, 15 Oct 2008 14:42:40 -0700 (PDT)

Hi Carlo,

    Can you please tell what .* do to the equation. Also how would you write
a generalised piecewise function like

f(t) =  a(t) t < t0
         b(t) t = t0
         c(t) t > t0

thanks in advance,
k3.
 

Carlo de Falco-2 wrote:
> 
> 
> 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.
> 
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Piecewise-function-in-octave-tp20002314p20003062.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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