What is wrong with my solve function?
古いコメントを表示
This is an example from the solve documentation, however my matlab isn't getting the same output as the example. Does anyone know why this is happening? The output is supposed to be solx=pi/2
Matlab Code:
syms x
eqn = sin(x) == 1;
solx = solve(eqn,x)
x =
x/sin(x) == x
solx =
x/sin(x) == x
回答 (2 件)
Steven Lord
2016 年 10 月 21 日
0 投票
Did you previously define a variable named sin that's taking precedence over the built-in sin function? You can check this using the which function.
Run only the first half of it. x has to be symbolic.
if true
syms x
eqn = sin(x) == 1;
solx = solve(eqn,x)
end
カテゴリ
ヘルプ センター および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!