help-octave
[Top][All Lists]
Advanced

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

Output function


From: Juan Pablo Carbajal
Subject: Output function
Date: Tue, 27 Sep 2011 16:09:24 +0200

Hi all,

I want to generate a function that retruns a function. Example
t=linspace(0,1,100);
y = sin(2*pi*t);
func = data2fun(t,y)

where data2func looks like

function f = data2fun (t, y)
 pp = spline (t, y);
 f = @(t_) ppval (pp, t_);
end

Is there a better way to do it?

Thanks

-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Z├╝rich
http://ailab.ifi.uzh.ch/carbajal/


reply via email to

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