Not getting the right output using 'fsolve'
Afficher commentaires plus anciens
Hi all,
I am trying to practice with 'fsolve' and have not figured out fully what's been going on with the following code. Can anyone please shed some light on it?
function N=productivity1(N,Ac,Aw)
global Thetac Thetaw tau a b
N=[N(1),N(2)];
N=[N(1)-(Thetac/a)^(1/b)*(1+tau)*Ac;
N(2)-(Thetaw/a)^(1/b)*(1+tau)*Aw;
N(1)+N(2)-1]; %this meant to be a constraint...
end
N0=[0.7,0.3]; %initial guess for x
option=optimset('Display','iter');
result=fsolve(@(N)productivity1(N,Ac0,Aw0),N0,option);*
I must be coding it incorrectly. Much appreciated! Thank you
3 commentaires
We cannot know what you don't like about the results unless you tell us. We also can't test the code ourselves without knowing
Thetac Thetaw tau a b Ac Aw
mrrox
le 29 Nov 2014
Réponse acceptée
Plus de réponses (1)
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!