fsolve vs solve and linear equations

25 ビュー (過去 30 日間)
Tigmanshu Patel
Tigmanshu Patel 2019 年 2 月 14 日
回答済み: Alan Weiss 2019 年 2 月 15 日
I attempted solving a linear equation by solve and fsolve. there are two variables of which one is unknown while other is known.
However i find that the answer provided by fsolve was more accurate than solve. Besides that fsolve also was computationally efficient. I also notice that fsolve changes the known value as well.
Why does it happen? Can fsolve be used for solving linear equation?

回答 (1 件)

Alan Weiss
Alan Weiss 2019 年 2 月 15 日
I don't know if you are solving with Symbolic Math Toolbox™ or Optimization Toolbox™.
If you have numeric equations (not symbolic), then you should probably use either backslash or, for one variable, an explicit solution. fsolve is for solving systems of nonlinear equations. Or, if you like, you can use fzero, but usng a nonlinear solver to solve a linear equation seems inefficient.
If you have symbolic variables (not numeric) then I am not sure of the best advice.
Alan Weiss
MATLAB mathematical toolbox documentation

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by