Why is does the y axis of the graph have the same value all the way down?
Ältere Kommentare anzeigen
Hello, I am very new to Matlab and I have just started learning to produce graphs. I tried to run the code:
y =@(t) 1.11*cos(2*pi*100000*t) + 0.5*cos(2*pi*98000*t) + 0.5*cos(2*pi*102000*t); x = -1*pi:0.1:pi; plot(x,y(x));
The graph produced is:
As you can see, it has -0.145 all the way down the y axis and I have no idea why. Is this a problem with the code? Thank you very much in advance!

Akzeptierte Antwort
Weitere Antworten (1)
Giorgos Papakonstantinou
am 4 Mär. 2015
Bearbeitet: Giorgos Papakonstantinou
am 4 Mär. 2015
Because y(x) barely changes in the interval 1*pi:0.1:pi.
Try a more densely spaced vector: i.e.
x = -1*pi:pi/180:pi;
1 Kommentar
pp6g
am 4 Mär. 2015
Kategorien
Mehr zu Graph and Network Algorithms finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

