double integral and fitted functions
2 ビュー (過去 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 で Spline Postprocessing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!