How to include both Fixed and unknown values in fsolve
이전 댓글 표시
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,
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!