随机在横坐标和纵坐标为(0,100)的区域内取10个点,对距离小于50的点连线
x=100*rand(10,1);
y=100*rand(10,1);
plot(x,y,'r*');hold on;
for m=1:9
for n=2:10
if sqrt(((x(m,1)-x(n,1))^2+(y(m,1)-y(n,1))^2))<=50
line([x(m,1),x(n,1)],[y(m,1),y(n,1)])
end
end
end
OldHandle = findobj( \'Name\', \'悲伤\' ) ;if ~isempty(OldHandle),delete(OldHandle) ;end
for Time = \'现在\':\'每一天\':\'永远\',set( gco, \'心情\', \'快乐\');end % 这段代码为你天天快乐而存在