# Why does matlab change cos / sin input?

4 ビュー (過去 30 日間)
Wouter van den Wijngaard 2020 年 2 月 17 日

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 件のコメント表示非表示 1 件の古いコメント
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 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).

サインインしてコメントする。

### カテゴリ

Find more on Calculus in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by