How to draw a butterfly in MATLAB?

Actually, it is very simple. Here is the code:

%graph of butterfly theta = 0:0.01:2*pi; rho=(cos(5.*theta)).^2+ sin(3.*theta)+0.3; polar(theta,rho,'r'); title('Graph of Butterfly Curve')

Sep 22 2016- POSTED BY bearhuzj
zero comment

How to draw a butterfly in MATLAB?

Actually, it is very simple. Here is the code:

%graph of butterfly theta = 0:0.01:2*pi; rho=(cos(5.*theta)).^2+ sin(3.*theta)+0.3; polar(theta,rho,'r'); title('Graph of Butterfly Curve')