Not getting the right output using 'fsolve'
Mostrar comentarios más antiguos
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 comentarios
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
el 29 de Nov. de 2014
Respuesta aceptada
Más respuestas (1)
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!