Why can't I get exact cosine waveform?
2 views (last 30 days)
Show older comments
I write following in my MATLAB to generate cosine plot. Why the peak of this wave is like triangular shape? is it a problem with plot() command?
>> t = 0:1*10^-3:40*10^-3; >> v = 120*1.41*cos(120*pi*t); >> i = (5*1.41/6)*cos(120*pi*t); >> p = v.*i; >> plot(t,p);
0 Comments
Accepted Answer
Star Strider
on 1 Jun 2014
Your t vector only produces 41 points to evaluate. Change it to:
t = linspace(0,40E-3,250);
to create a vector over the same interval with 250 points. That should smooth it.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!