Integral a function handle of two variables with respect to a variable
17 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Walter Roberson
on 2 Dec 2021
f = @(x, y) x+y;
g = @(x) integral(@(y) f(x,y), 0, 1, 'arrayvalued', true)
t = (0:0.1:1);
g(t)
More Answers (0)
See Also
Categories
Find more on Oceanography and Hydrology in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!