MATLAB Program for Drawing two circles one having radius twice the other

Using Matlab

Draw two sine waves connected together, one of which has twice the frequency of other.

Program

%Program Code for Drawing two circles one having radius twice the other
%provided by electricalvoice.com
clc
clear all
x=input('Enter x-cordinate of center of circle:');
y=input('Enter y-cordinate of center of circle:');
r=input('Enter radius of circle:');
ang=0:0.01:2*pi; 
xp=r*cos(ang);
yp=r*sin(ang);
plot(x+xp,y+yp)
hold on 
plot(x+2*xp,y+2*yp)
hold off

 

Leave a Comment

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