MATLAB: To plot the sin signal continues and discrete form

to plot graph

To plot the sin signal continues and discrete form —I had done the some part of code but using plot command showing error Code: fs=100; % sampling frequency t=0:1/fs:1; % setup time from 0 to 1 second f=5; % input frequency x=sin; % input signal subplot(211); plot(t,x);

Best Answer

fs = 100;
t = 0:1/fs:1;
f = 5;
x = sin(2*pi*f*t);
subplot(211)
plot(t,x);