2011数学建模b题完整程序.doc_第1页
2011数学建模b题完整程序.doc_第2页
2011数学建模b题完整程序.doc_第3页
2011数学建模b题完整程序.doc_第4页
2011数学建模b题完整程序.doc_第5页
已阅读5页,还剩9页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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,全市交通路口的路线)xyznpathnumz=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(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(:,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 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*);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)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),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)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)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(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(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(line1(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(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)=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*);endend-for 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)=line1(i)tmp(tmp1,2)=line2(i)endendendxlswrite(tmp.xls,tmp)clc;clearshapex = 413403383.5381339335317334.5333282247219225280290337415432418444251234225212227256250.5243246314315326327328336331371388.5411419411394342325315342345348.5351348370371354363357351369335381391392395398401405410408415418422418.5405.5405409417420424438438.5434438440447448444.5441440.5;shapey = 359343351377.5376383362353.5342325301316270292335328335371374394277271265290300301306328337367351355350342.5339334335330333330.5327.5344343346342348372374372382380.5377369363353374382.5387382388395381375366361362359360355350351347354356364.5368370364370372368373376385392381383385381.5;n=length(shapex);for i=1:nfor j=1:ndistance(i,j)=sqrt(shapex(i)-shapex(j)2+(shapey(i)-shapey(j)2);endenddistancea=zeros(n);max_value=zeros(n);for k=1:nmax_line,column=max(distance(k,:);a(k,column)=max_line;endmax_value(k,column)=max(max(a)i,j=find(max_value)point_start=shapex(i) shapey(i)point_end=shapex(j) shapey(j)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);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(line1(i)=92)if(line2(i)=92)line(x(line1(i),x(line2(i),y(line1(i),y(line2(i);endendendx=x=num(:,2)num2,data2=xlsread(c:usersyaokaiqiandesktopcumcm2011problems中文版bcumcm2011b附件2_全市六区交通网路和平台设置的数据表.xls)hold onfor i=1:length(x)if(strcmp(z(i),a)plot(x(i),y(i),.);i

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论