【#文档大全网# 导语】以下是®文档大全网的小编为您整理的《情人节MATLAB画爱心的小礼物》,欢迎阅读!
哈哈哈,笑cry啊,七夕写这个MATLAB代码给女朋友们,好醉~~~ 废话不多说,直接上!!
y1=1:0.01:3; x1=1+0.*y1; x2=1:0.01:2; y2=1+0.*x2; x3=6+0.*y1; x4=6:0.01:7; y3=2+0.*x4; y4=3+0.*x4; y5=1+0.*x4; x6=0:0.01:5; y6=x6;
t=0:0.1:2*pi; x=0.6*sin(t)+3; y=cos(t)+2;
x7=3.9:0.0001:5.5;
y7=(abs(x7-4.7))*2.5+1;
x8=7:0.001:11; y8=x8-4;
t1=-pi:0.01:pi; x9=8*(sin(t1).^3);
x10=(16/3)*(sin(t1).^3)+5.5;
y10=(13*cos(t1)-5*cos(2*t1)-2*cos(3*t1)-cos(4*t1))/3-2.7; y9=(13*cos(t1)-5*cos(2*t1)-2*cos(3*t1)-cos(4*t1))/2;
plot(x9,y9,'c','linewidth',3) hold on
plot(x10,y10,'c','linewidth',3)
hold on
plot(x1,y1,'r','linewidth',3); hold on
plot(x2,y2,'r','linewidth',3); hold on
plot(x3,y1,'r','linewidth',3); hold on
plot(x4,y3,'r','linewidth',3); hold on
plot(x4,y4,'r','linewidth',3); hold on
plot(x4,y5,'r','linewidth',3); hold on
plot(x6,y6,'w'); hold on
plot(x,y,'r','linewidth',3); axis equal; hold on
plot(x7,y7,'r','linewidth',3) hold on
plot(x8,y8,'w')
效果图,么么哒。。。
本文来源:https://www.wddqxz.cn/3f547afb561252d381eb6e4a.html