Why does matlab change cos / sin input?

조회 수: 1 (최근 30일)
Wouter van den Wijngaard
Wouter van den Wijngaard 2020년 2월 17일
답변: Siriniharika Katukam 2020년 2월 20일
Hello,
Something very weird happens when i try to integrate cos / sin functions. Matlab changes te values i put in the cos / sin for example this happens when i want to integrate acceleration (a) to speed (v):
>> syms x
>> a=cos(-2*x+3)
a =
cos(2*x - 3)
How can i avoid this?
  댓글 수: 2
John D'Errico
John D'Errico 2020년 2월 17일
Why does it matter at all? cos(X) == cos(-X). So it changes nothing.
Stephen23
Stephen23 2020년 2월 17일
"Something very weird happens when i try to integrate cos / sin functions..."
Why is it weird? They are exactly equivalent.

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

답변 (1개)

Siriniharika Katukam
Siriniharika Katukam 2020년 2월 20일
Hi
Assuming that your issue is the change of signs in the "cos" function, the interpreted value of a as cos(2*x - 3) is right as "cos(x) = cox(-x)". You will get the same values when you try to integrate both cos(-2*x + 3) and cos(2*x – 3).

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by