Why does solve(1 == 1, t) return 0 as an answer?
古いコメントを表示
I understand that the solution of the equation 1=1 in terms of t is all t. Now, when I ask MATLAB to solve(1 == 1, t) it returns 0. This problem arose from a vector valued function who's derivative imposed to equal 1 had more than one solution and MATLAB wasn't giving them.
3 件のコメント
Walter Roberson
2022 年 2 月 28 日
In terms of t, you would have

But 1 = 1 is true in any logic system in which = represents equality and the symbol 1 exists, so
is always false, and the set of t such that false is true is empty. So the second part is the empty set, and so the solution is the set of all t . There is no t such that 1=1 is false so all t are included in the solution.
is always false, and the set of t such that false is true is empty. So the second part is the empty set, and so the solution is the set of all t . There is no t such that 1=1 is false so all t are included in the solution.
Walter Roberson
2022 年 2 月 28 日
Tips
If the solution contains parameters and ReturnConditions is true, solve returns the parameters in the solution and the conditions under which the solutions are true. If ReturnConditions is false, the solve function either chooses values of the parameters and returns the corresponding results, or returns parameterized solutions without choosing particular values. In the latter case, solve also issues a warning indicating the values of parameters in the returned solutions
So, solve() sometimes chooses values for the parameters, so choosing 0 in this case is not contrary to the documentation.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

