use fzero and quad to find area. I really need help with this one.!! Thank you so much guys
Show older comments

Assuming functions F and G have been previously defined. Give the matlab command that would compute and display the area of the closed region R.
function[fc]=Intersect(x,b,c); fc=F(x,b)-G(x,c); XL1=fzero(@F,0.7,[],b); XR1=fzero(@F,1,[],b); a=quad(@F,XL1,XR1,[],[],b); XL2=XR1; XR2=fzero(@G,1.5,[],c); b=quad(G,XL2,XR2,[],[],c); R=a+b that's what i put in the script file but it doesn't run properly and it still has error.
3 Comments
Yannick
on 16 Oct 2013
Jason, have you given this a try already? Can you attach your code and explain what difficulties you are having with it?
jason nguyen
on 17 Oct 2013
Edited: Walter Roberson
on 17 Oct 2013
Walter Roberson
on 17 Oct 2013
What error shows up?
Answers (1)
Walter Roberson
on 17 Oct 2013
fzero "fun accepts a scalar x and returns a scalar " But your F and G require two parameters, not one, so you cannot use them directly in fzero. And although you calculate fc, you do not use it.
Perhaps what you want is something like
fc = @(x) F(x,b) - G(x,c);
XL1 = fzero(fc, 0.7);
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!