MATLAB: I need to plot a sine wave

ametueramplitudecoscosinefrequencyplotsinsinesine wavetimeuniversitywave

I need to plot a sine wave with a frequency of 15 amplitude of 4 time of 0:0.1:1 how do i go about this, thanks 🙂

Best Answer

Francis - from an example at fft, we can do
t = 0:0.01:1;
f = 15;
a = 4;
y = a*sin(2*pi*f*t);
plot(t,y);
Though ten samples (your t) may not be enough to accurately represent the sine wave (that you are attempting), so try
Fs = 1000;
t = linspace(0,1-1/Fs,Fs);
f = 15;
a = 4;
y = a*sin(2*pi*f*t);
plot(t,y);
Related Question