I am confused about how plot and axis functions are used here. Normally, plot should be used as plot(time, ySound), but here plot(ySound) can work by itself. Why?
I understand that in axis([0 100 -1.1 1.1]), the first two digits actually represent the first 100 samples. However, shouldn't the first two digits of the axis function be used to represent the limits of the time?
sampleFreq = 8000; freqMiddleC = 261.63; amplitude = 1;
time = linspace(0, 2, sampleFreq * 2);
ySound = amplitude * sin(2 * pi * freqMiddleC * time);
sound(ySound, sampleFreq);
figure(1);
plot(ySound, 'o', ...
'MarkerSize', 6, ...
'MarkerFaceColor', 'r', 'MarkerEdgeColor', 'r');
axis([0 100 -1.1 1.1]); xlabel('time');
Thanks in advance,
- Lisa