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
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.

댓글 수: 1

Jarren  Suzuki
Jarren Suzuki 2016년 10월 24일
No thats not the problem, I realized that it might have to do with the pathing of my solve function because when I type in "help solve" I get the output "No help found for solve.m" If you know how to help with that problem it would be greatly appreciated.

댓글을 달려면 로그인하십시오.

Chaya N
Chaya N 2016년 10월 21일
편집: Chaya N 2016년 10월 21일

0 개 추천

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

카테고리

태그

질문:

2016년 10월 21일

편집:

2016년 10월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by