MATLAB Program for plotting Two sine waves connected together, one of which has twice the frequency of other.

Program

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
%Two sine waves connected together,one of which has twice the frequency of other %provided by electricalvoice.com clc clear all fr= input('Enter frequency in Hz:'); stptime = input('Enter Stop time in Second:'); frad = 2*pi*fr; t = 0:0.005:stptime; y1 = sin(frad * t); plot(t,y1) hold on y2 = sin(2 * frad * t); plot(t,y2) xlabel('Time (seconds)') ylabel('y(t)') |

MATLAB Program for Plotting Two sine waves Connected Together