Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#3 |
初级会员
注册日期: 2007-05-20
年龄: 45
帖子: 10
声望力: 19 ![]() |
![]()
clc;
clear; a=eye(10,11); for j=1:1:10 for i=1:1:11 if a(j,i)==0 rectangle('Position',[i,1,1,0.5],'Curvature',[0,0],'FaceColor','r','edgecolor','r'); else rectangle('Position',[i,1,1,0.5],'Curvature',[0,0],'FaceColor','g','edgecolor','g'); end end xlim([1,12]) ; ylim([-8,8]) ; set(gca,'visible','off'); pause(0.5) end |
![]() |
![]() |