plot a heart in matlab

Here's the code to plot a heart using MATLAB:

main.m
t = linspace(0,2*pi);
x = 16*sin(t).^3;
y = 13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t);

plot(x,y)
axis equal
title('Heart')
123 chars
8 lines

You can customize the plot as per your need. Enjoy!

related categories

gistlibby LogSnag