How to include both Fixed and unknown values in fsolve
Mostrar comentarios más antiguos
I am wanting to solve a system of equations for 2 unknowns and 1 "fixed" value. I have read through Matt's Answer here but am even more confused on how to do so. Here is the code. x and y are my unknowns and u is a "fixed" value.
r=[1 2];
u= 5;
guess=[1,1];
output= fsolve(myfun(r,u),guess);
function F=myfun(r,u)
x = r(1);
y = r(2);
F(1)=x+5*y^2+u;
F(2)=x^2+4*y+u;
end
Cheers,
Respuestas (0)
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!