Matlab ignores pi in a function
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Alex CB
el 3 de En. de 2016
Editada: Walter Roberson
el 4 de En. de 2016
When I try to use:
syms x; y=3*cos(pi-x^2); diff(y)
it gives
6*x*sin(x^2)
it ignores the pi, giving an incorrect solution and I don't know how to solve it.
It also says that "y=-3*cos(x^2)", ignoring the pi again.
Thanks in advance.
0 comentarios
Respuesta aceptada
Image Analyst
el 3 de En. de 2016
Why do you incorrectly think that cos(pi-theta) is not equal to -cos(theta)? It is. Just try plotting some angles on the unit circle to prove it to yourself. So you can use either equation because they are equivalent.
Más respuestas (0)
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!