Integral a function handle of two variables with respect to a variable
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jingyu Liu
am 2 Dez. 2021
Kommentiert: Jingyu Liu
am 2 Dez. 2021
f = @(x, y) x+y;
g = @(x) integral(@(y) f(x,y),0,1)
t = (0:0.1:1);
g(t)
It is wrong! How can I get the expected result?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 2 Dez. 2021
f = @(x, y) x+y;
g = @(x) integral(@(y) f(x,y), 0, 1, 'arrayvalued', true)
t = (0:0.1:1);
g(t)
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!