double integral and fitted functions
1 次查看(过去 30 天)
显示 更早的评论
Hi guys,
I have two fitted functions a(t)and b(t). Both via splines. I need to compute an integral:
integral(func,0,1)
where func=a(u)*integral(b(t),0,u).
I know that I can do integrate(cf,0,1) for a fitted object. But how can I compute a double integral?
Thanks.
Daniel.
回答(1 个)
Mike Hosea
2013-7-9
I'm going to treat this like a homework problem. You'll need to define some anonymous functions. For example, if b is a pp-form, you can create a function that evaluates b by
bfun = @(x)ppval(b,x);
and
bint = @(u)integral(bfun,0,u);
Then you can build up to the point where you can define func. There's more to know, e.g. about "vectorizing" bint with ARRAYFUN before using it, or choosing the 'Arrayvalued' option in the outer integral. You can find some threads on that. But first you need to get started by understanding how to define anonymous functions in MATLAB.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Splines 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!