Matlab表达爱心代码
【代码】Matlab表达爱心代码。
·
t = linspace(0, 2*pi, 1000);
x = 16*sin(t).^3;
y = 13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t);
% 设置图形窗口颜色为淡粉色
set(gcf,'Color',[255/255, 228/255, 225/255]);
% 绘制爱心
plot(x,y,'r','LineWidth',3);
% 添加文字
text(0,0,'I Love You','FontSize',18,'Color','red');
% 设置坐标轴属性
axis equal off;
更多推荐
所有评论(0)