1、数学建模b题完整程序num,data=xlsread(F:建模cumcm2011Problems中文版Bcumcm2011B附件2_全市六区交通网路和平台设置的数据表.xlsx)x=num(:,2)y=num(:,3)plot(x,y,r.)num1,data1=xlsread(F:建模cumcm2011Problems中文版Bcumcm2011B附件2_全市六区交通网路和平台设置的数据表.xlsx)num2,data2=xlsread(F:建模cumcm2011Problems中文版Bcumcm2011B附件2_全市六区交通网路和平台设置的数据表.xlsx,全市交通路口的路线)xyznpat
2、hnumz=data:,4dataz=data:,4data:,4datedataz=data(:,4)hold onfor i=1:length(x)if(strcmp(z(1),A)plot(x(i),y(i),.)endendhold onfor i=1:length(x)if(strcmp(z(1),A)plot(x(i),y(i),.)endendhold onfor i=1:length(x)if(strcmp(z(i),A)plot(x(i),y(i),.)endendz=z(2:end)hold onfor i=1:length(x)if(strcmp(z(i),A)plot(
3、x(i),y(i),.)endendhold onfor i=1:length(x)if(strcmp(z(i),A)plot(x(i),y(i),.)endendnum1,data1=xlsread(C:UsersyaokaiqianDesktopcumcm2011Problems中文版Bcumcm2011B附件2_全市六区交通网路和平台设置的数据表.xls)num2,data2=xlsread(C:UsersyaokaiqianDesktopcumcm2011Problems中文版Bcumcm2011B附件2_全市六区交通网路和平台设置的数据表.xls,全市交通路口的路线)m=num1(:
4、,6)m=num(:,6)num1,data1=xlsread(C:UsersyaokaiqianDesktopcumcm2011Problems中文版Bcumcm2011B附件2_全市六区交通网路和平台设置的数据表.xls)m=num1(:,6)n=num1(:,7)hold onfor i=1:length(x)if(strcmp(z(i),A)plot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i),y(i),r*);endendendline1=num2(:,1)line2=num2(:,2)hold o
5、nfor i=1:length(x)if(strcmp(z(i),A)plot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i),y(i),r*);endendendfor i=1:length(line1)if(line1(i)=92)if(line2(i)=92)line(x(line1(i),x(line2(i),y(line1(i),y(line2(i);endendendhold onfor i=1:length(x)if(strcmp(z(i),A)plot(x(i),y(i),.);if(m(i)=1
6、)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i),y(i),r*);endtext(x(i),y(i),num2str(i);endend %差一个点就OK了for i=1:length(line1)if(line1(i)=92)if(line2(i)=92)line(x(line1(i),x(line2(i),y(line1(i),y(line2(i);endendend -hold onfor i=1:length(x)plot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i
7、),y(i),r*);endendfor i=1:length(line1)line(x(line1(i),x(line2(i),y(line1(i),y(line2(i);endendhold onfor i=1:length(x)plot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i),y(i),r*);endendfor i=1:length(line1)line(x(line1(i),x(line2(i),y(line1(i),y(line2(i);endhold onfor i=1:length(x)p
8、lot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i),y(i),r*);endendfor i=1:length(line1)line(x(line1(i),x(line2(i),y(line1(i),y(line2(i);endhold onfor i=1:length(x)if(strcmp(z(i),A)plot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i),y(i),r*);endtext(x(i),y(i),num2s
9、tr(i);endendfor i=1:length(line1)if(line1(i)=92)if(line2(i)=92)line(x(line1(i),x(line2(i),y(line1(i),y(line2(i);endendendhold onfor i=1:length(x)if(strcmp(z(i),A)plot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i),y(i),r*);endtext(x(i),y(i),num2str(i);endendfor i=1:length(line1)if(
10、line1(i)=92)if(line2(i)=92)line(x(line1(i),x(line2(i),y(line1(i),y(line2(i);endendendhold onfor i=1:length(x)if(strcmp(z(i),A)plot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i),y(i),r*);endtext(x(i),y(i),num2str(i);endendfor i=1:length(line1)if(line1(i)=92)if(line2(i)=92)line(x(li
11、ne1(i),x(line2(i),y(line1(i),y(line2(i);endendendfor i=1:length(line1)line(x(line1(i),x(line2(i),y(line1(i),y(line2(i);endhold onfor i=1:length(x)plot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i),y(i),r*);endtext(x(i),y(i),num2str(i); endendfor i=1:length(line1)line(x(line1(i),x(
12、line2(i),y(line1(i),y(line2(i);end -全图hold onfor i=1:length(x)plot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i),y(i),r*);endendfor i=1:length(line1)line(x(line1(i),x(line2(i),y(line1(i),y(line2(i);endtmp=cat(2)tmp1=1;for i=1:length(line1)if(line1(i)=92)if(line2(i)=92)tmp(tmp1,1)=
13、line1(i)tmp(tmp1,2)=line2(i)endendendxlswrite(tmp.xls,tmp)hold onfor i=1:length(x)if(strcmp(z(i),A)plot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro);endif(n(i)=1)plot(x(i),y(i),r*);endtext(x(i),y(i),num2str(i);endend-for i=1:length(line1)if(line1(i)=92)if(line2(i)=92) 连线line(x(line1(i),x(line2(i),y(line1(i),y(line2(i);endendend-hold onfor i=1:length(x)plot(x(i),y(i),.);if(m(i)=1)plot(x(i),y(i),ro); 描点 endif(n(i)=1)plot(x(i),y(i),r*
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1