Why does my sin graph look like a triangle?
显示 更早的评论

4 个评论
Cris LaPierre
2023-5-10
We would have to know what your function dfdt is doing in order to say for certain. Please copy/paste all your code here so we can run it and see.
James Tursa
2023-5-10
@Roos Never post code as an image ... we can't run images at our end. Please always post code as regular text highlighted with the CODE button.
Cris LaPierre
2023-5-11
You can obviously post pictures, but then you are asking the community to rewrite yout code from a picture. It's much simpler for us if you just copy/paste your code instead.
回答(1 个)
Cris LaPierre
2023-5-10
0 个投票
Your sin wave is plotted just fine. However, it looks like a straight line because the magnitude of your second plot (in red) is so much larger (1 vs 5e5)
3 个评论
Roos
2023-5-11
"how do I change the magnitude?"
Rather than changing your data, I suspect that YYAXIS or PLOTYY is what you are looking for:
Cris LaPierre
2023-5-11
编辑:Cris LaPierre
2023-5-11
BTW, the derivative of sin is cosine. So the correct plot should show a sin and cosine wave of the same frequency and amplitude.
类别
在 帮助中心 和 File Exchange 中查找有关 Image Arithmetic 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!