use fzero and quad to find area. I really need help with this one.!! Thank you so much guys
Afficher commentaires plus anciens

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 commentaires
Yannick
le 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
le 17 Oct 2013
Modifié(e) : Walter Roberson
le 17 Oct 2013
Walter Roberson
le 17 Oct 2013
What error shows up?
Réponses (1)
Walter Roberson
le 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);
Catégories
En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!