Filter löschen
Filter löschen

error when using diff() on trigonometric functions

1 Ansicht (letzte 30 Tage)
alex pabouctsidis
alex pabouctsidis am 14 Mär. 2013
Hello,
When i try to apply this in matlab:
syms x
diff(cos(x))
I get :
ans =
diff(cos(x), x)
Instead of -sin(x) as expected. The examples and help show that it should work for trig functions and I don't understand why this isn't working for me.
Is this a kind of bug? Has anyone encountered this before?
Thanks, Alex
  4 Kommentare
Jan
Jan am 14 Mär. 2013
Did you create a variable or function called "cos" before?
alex pabouctsidis
alex pabouctsidis am 14 Mär. 2013
I had a syms cos(phi) for another variable, which in hindsight was a bit dumb :P
i removed it and it works now.
thanks!

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by