How to Double-integrate a Function with Three Variables Using quad2d
Show older comments
I have a question regarding double integration in MATLAB. I have three variables x, y, and z in the function I want to integrate, but want to integrate on x and y only. I am expecting the resulting equation to be a function of z, which may be more like a simplify function.
>> fun =@(x,y,z) 1/4.*max(x-(1+z)*y, 0); >> integral_fun = quad2d(fun,0,2,0,2) ??? Input argument "z" is undefined.
Error in ==> @(x,y,z)1/4.*max(x-(1+z)*y,0)
Error in ==> quad2d>tensor at 355 Z = FUN(X,Y); NFE = NFE + 1;
Error in ==> quad2d at 169 [Qsub,esub] = tensor(thetaL,thetaR,phiB,phiT);
Please help me out. Thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Numerical Integration and Differentiation 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!