关于matlab的fopen命令。。。标题要长一点!!~~~
我现在做导纳矩阵老师给我们个命令
fid=fopen('rts24.txt','r');
N=fscanf(fid,'%f',[1,1]);NL=fscanf(fid,'%f',[1,1]);NLCN=fscanf(fid,'%f',[1,1]);
AA=fscanf(fid,'%f',[11,N]);SS=AA';
BB=fscanf(fid,'%f',[10,NL]);ZL=BB';
CC=fscanf(fid,'%d',[3,NLCN]);NLC=CC';
fclose(fid);
rts24.txt里的内容是(24个节点,34条线路)
24 34
1 2 .0026 .0139 .2305 1.0000
1 3 .0546 .2112 .0286 1.0000
2 4 .0328 .1267 .0171 1.0000
1 5 .0218 .0845 .0115 1.0000
2 6 .0497 .1920 .0260 1.0000
7 8 .0159 .0614 .0083 1.0000
3 9 .0308 .1190 .0161 1.0000
4 9 .0268 .1037 .0140 1.0000
8 9 .0427 .1651 .0224 1.0000
5 10 .0228 .0883 .0119 1.0000
6 10 .0139 .0605 1.2295 1.0000
8 10 .0427 .1651 .0224 1.0000
9 11 .0023 .0839 .0000 1.0000
10 11 .0023 .0839 .0000 1.0000
9 12 .0023 .0839 .0000 1.0000
10 12 .0023 .0839 .0000 1.0000
11 13 .0061 .0476 .0499 1.0000
12 13 .0061 .0476 .0499 1.0000
11 14 .0054 .0418 .0439 1.0000
15 16 .0022 .0173 .0182 1.0000
14 16 .0050 .0389 .0409 1.0000
16 17 .0033 .0259 .0272 1.0000
17 18 .0018 .0144 .0151 1.0000
16 19 .0030 .0231 .0242 1.0000
19 20 .0026 .0198 .0416 1.0000
15 21 .0032 .0245 .0515 1.0000
18 21 .0017 .0130 .0545 1.0000
17 22 .0135 .1053 .1106 1.0000
21 22 .0087 .0678 .0712 1.0000
12 23 .0124 .0966 .1015 1.0000
13 23 .0111 .0865 .0909 1.0000
20 23 .0014 .0108 .0455 1.0000
3 24 .0023 .0839 .0000 1.0000
15 24 .0067 .0519 .0545 1.0000
1 -1 1.9200 .7600 1.0800 .2200 1.0000
2 1 1.9200 .8000 .9700 .2000 1.0000
3 1 .0000 .0000 1.8000 .3700 1.0000
4 1 .0000 .0000 .7400 .1500 1.0000
5 1 .0000 .0000 .7100 .1400 1.0000
6 -1 .0000 .0000 1.3600 .2800 1.0000
7 -1 3.0000 1.8000 1.2500 .2500 1.0000
8 1 .0000 .0000 1.7100 .3500 1.0000
9 1 .0000 .0000 1.7500 .3600 1.0000
10 1 .0000 .0000 1.9500 .4000 1.0000
11 1 .0000 .0000 0.0000 .0000 1.0000
12 1 .0000 .0000 0.0000 .0000 1.0000
13 -1 5.9100 2.4000 2.6500 .5400 1.0000
14 -1 .0000 .0000 1.9400 .3900 1.0000
15 1 2.1500 1.1000 3.1700 .6400 1.0000
16 1 1.5500 .8000 1.0000 .2000 1.0000
17 1 .0000 .0000 0.0000 .0000 1.0000
18 1 4.0000 2.0000 3.3300 .6800 1.0000
19 1 .0000 .0000 1.8100 .3700 1.0000
20 1 .0000 .0000 1.2800 .2600 1.0000
21 -1 4.0000 2.0000 .0000 .0000 1.0000
22 -1 3.0000 .9600 .0000 .0000 1.0000
23 0 .0000 .0000 .0000 .0000 1.0000
24 1 .0000 .0000 0.0000 .0000 1.0000
要将这些数据列成矩阵。。怎么编程啊。。
谢谢了
rts24.rar
(973 Bytes)