精选优质文档-倾情为你奉上模型一的matlab程序!A为邻接矩阵;T,T2分别为铁路的矩阵和铁路的费用矩阵;R,R2分别为公路的矩阵和公路的费用矩阵;w,Q为总费用矩阵;cost为S到A的各项费用矩阵A=ones(39,39);for i=1:39; for j=1:39; if i=j A(i,j)=0; else A(i,j)=inf; end endend A(8,10)=450;A(9,10)=80;A(10,11)=1150;A(11,16)=1100;A(12,13)=306;A(13,14)=195;A(1,14)=20;A(1,16)=202;A(2,16)=1200;A(16,17)=720;A(3,17)=690;A(17,18)=520;A(18,19)=170;A(4,19)=690;A(19,20)=160;A(5,15)=462;A(15,19)=88;A(20,21)=70;A(20,22)=320;A(22,23)=160;A(6,23