solving trigonometric equations problem

1 visualización (últimos 30 días)
Dirk
Dirk el 2 de Dic. de 2012
Hi
I want to solve following trigonmetric equation in matlab 2010
cos(alpha) = 0.5
and I want to get alpha in degrees, so...60
I Tried following code,...
syms x
s = solve(cos(x)== 1)
but i get this:
*_??? Error using ==> char
Conversion to char from logical is not possible.
Error in ==> solve>getEqns at 169
vc = char(v);
Error in ==> solve at 67
[eqns,vars] = getEqns(varargin{:})_*
Thans in advance...

Respuestas (2)

Azzi Abdelmalek
Azzi Abdelmalek el 2 de Dic. de 2012
syms x
s = solve(cos(x)-0.5)*180/pi

Walter Roberson
Walter Roberson el 2 de Dic. de 2012
Your MATLAB version is not new enough to understand using == in a symbolic expression. R2012a or later is required for that. Use Azzi's solution -- i.e.,
solve(A==B)
being equivalent to
solve((A)-(B))

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by