How to include both Fixed and unknown values in fsolve
Afficher commentaires plus anciens
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,
Réponses (0)
Catégories
En savoir plus sur Linear Algebra 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!