作业帮 > 数学 > 作业

matlab画图,画出任意两点间的连线图,请高人帮忙呀,谢谢!谢谢!

来源:学生作业帮 编辑:作业帮 分类:数学作业 时间:2024/11/07 19:16:29
matlab画图,画出任意两点间的连线图,请高人帮忙呀,谢谢!谢谢!
点坐标:x1=[1000,2711];
x2=[1210,2770];
x3=[1041,2610];
x4=[1499,2528];
x5=[850,2482];
x6=[1770,2180];
x7=[1970,2218];
x8=[1790,2155];
x9=[1333,2175];
x10=[1140,2100];
x11=[1320,2070];
x12=[1215,2052];
x13=[1160,1870];
x14=[776,1799];
x15=[1360,1750];
x16=[1520,1721];
x17=[1420,1470];
x18=[1770,1390];
x19=[1380,1280];
x20=[1120,1675];
x21=[978,1668];
x22=[910,1511];
x23=[1220,1424];
x24=[1020,1330];
x25=[1081,1160];
x26=[600,1511];
x27=[615,1498];
x28=[720,1440];
x29=[680,1370];
x30=[702,1290];
x31=[731,1220];
x32=[670,1160];
x33=[810,1120];
x34=[708,1131];
x35=[572,1050];
x36=[878,656];
x37=[888,592];
x38=[417,630];
点坐标还有这种方式
x=[1000,1210,1041,1499,850,1770,1970,1790,1333,1140,1320,1215,1160,776,1360,1520,1420,1770,1380,1120,978,910,1220,1020,1081,600,615,720,680,702,731,670,810,708,572,878,888,417];
y=[2711,2770,2610,2528,2482,2180,2218,2155,2175,2100,2070,2052,1870,1799,1750,1721,1470,1390,1280,1675,1668,1511,1424,1330,1160,1511,1498,1440,1370,1290,1220,1160,1120,1131,1050,656,592,630];
只要能编出来就可以,谢谢!
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
for m = (n+1):length(x)
plot(x([n,m],1),x([n,m],2),'b-');
end
end
% plot point
plot(x(:,1),x(:,2),'r*'); hold off;
点多,图就难看,好难看,
再问: 这个是任意两点间的吗?这么密集?
再答: 当然了,你有38个点,那么每个点就必须连37条线,想想总共有多少条?38*37/2=703