define a function in terms of an integral with variable limits

4 visualizzazioni (ultimi 30 giorni)
I have defined a function of two variables, say f(u,t), and would like to define a function g(t)=@(t)integral(f(u,t),u,[t-1,t]). How would I do this?

Risposta accettata

Torsten
Torsten il 31 Gen 2023
Modificato: Torsten il 31 Gen 2023
f1=@(t)3+2*cos(2*pi*t);
f2=@(t)4-3*sin(2*pi*t);
ff=@(t)-f1(t)-f2(t);
gg=@(u,t)integral(ff,u,t);
ww = @(u,t)f1(t).*exp(gg(u,t));
www=@(t)integral(@(u)ww(u,t),t-1,t,'ArrayValued',1);
www(2)
ans = 0.5163

Più risposte (0)

Categorie

Scopri di più su External Language Interfaces in Help Center e File Exchange

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by