% % 完全图
close all;
N=30;
t=0: 2*pi/N: 2*pi;
x = sin(t); y = cos(t);
figure('Name','Point-Line');
hold on;
% plotx-y lines
for n = 1: N-1
for m = (n+1): N
plot(x([n,m]), y([n,m]), 'b-');
end
end
plot(x(:),y(:),'rp');
xlabel('x');ylabel('y');
title('Point-Line');
hold off;
% axis off
%{
x = [1000,2711;1210,2770;1041,2610;1499,2528;850,2482;1770,2180;1970,2218;...
1790,2155;1333,2175;1140,2100;1320,2070;1215,2052;1160,1870;776,1799;...
1360,1750;1520,1721;1420,1470;1770,1390;1380,1280;1120,1675;978,1668;...
910,1511;1220,1424;1020,1330;1081,1160;600,1511;615,1498;720,1440;...
680,1370;702,1290;731,1220;670,1160;810,1120;708,1131;572,1050;...
878,656;888,592;417,630;];
figure('Name','Point-Line');
hold on;
% plot line
for n = 1 : length(x)-1 %做37次足矣
for m = (n+1) : length(x)
【matlab】《图论》-完全图仿真
最新推荐文章于 2024-06-15 15:31:53 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)