clc
close all
figure;
t=pi+pi/2:-0.01:pi/2;
x=1+1*cos(t);
y=-10+10*sin(t);
plot(x,y,'color',[0.2 0 0],'linewidth',3);
axis equal;
pause(2);
hold on;
t=0:0.01:2*pi;
x=10*cos(t);
y=3*sin(t);
for i=1:5
hold on; %
q=[x;y];
e=pi/5*i;
z=[cos(e) -sin(e);sin(e) cos(e)];
k=z*q;
r=k(1,:);
d=k(2,:);
fill(r,d,'y');
plot(r,d,'y','linewidth',5);
axis square; %
pause(1);
end
hold on;
x=3*cos(t);
y=3*sin(t);
patch(x,y,[0.2 0 0]);
哪位大佬能詳細講一下第一個%到第二個%的代碼意思,已經最后一個patch是干嘛呀。小生在此謝過!!!
uj5u.com熱心網友回復:
我大概運行了一下,中間兩個%之間的應該是用來畫花瓣的,你可以試著吧fill…和plot…的那一句中的'y'改成'r'就是個紅花了,哈哈哈,最后那個patch可以改變花蕊的顏色哦uj5u.com熱心網友回復:
感謝你哦!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/46743.html
標籤:匯編語言
