double integral and fitted functions

1 vue (au cours des 30 derniers jours)
Daniel
Daniel le 9 Juil 2013
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 commentaire
Daniel
Daniel le 9 Juil 2013
Pleease, help me!

Connectez-vous pour commenter.

Réponses (1)

Mike Hosea
Mike Hosea le 9 Juil 2013
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.

Catégories

En savoir plus sur Splines dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by