MATLAB Program for Plotting Two sine waves Connected Together

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

Program

%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)')

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need fund to operate the site, and almost all of it comes from our online advertising.

Please add electricalvoice.com to your ad blocking whitelist or disable your adblocking software.

×