Why does matlab change cos / sin input?
显示 更早的评论
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
2020-2-17
Why does it matter at all? cos(X) == cos(-X). So it changes nothing.
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
0 个投票
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).
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!