登录论坛

查看完整版本 : [MATLAB基础] 请教MATLAB数据编程的问题


shanghaigo
2009-05-04, 07:50
请教编程高手一个关于MATLAB数据编程的问题,请赐教。站内或邮件:[email protected]
在M1文件中有12台发电机的PMAX数据,在M2文件中有12台发电机的实际计算的PG数据。这12台发电机顺序编号。M1文件中的数据包括Column header 和 row header,其中PMAX是Column header 的其中一项,row header是1,1,2,2,22,22……13,13;M2文件中的数据也包括Column header 和 row header,其中PG是Column header 的其中一项,row header当然就是1,1,2,2,22,22……13,13咯。
现在我想计算这12台发电机的对应(PMAX-PG)数据之和,该如何编程序?
附:M1文件中的数据
% bus Pg Qg Qmax Qmin Vg mBase status Pmax Pmin apf
mpc.gen = [
1 5.88 0 15 -10 1 100 1 20 0 0;
1 10.3 0 26.25 -17.5 1 100 1 35 0 0;
2 19.05 0 18.75 -12.5 1 100 1 25 0 0;
2 22.87 0 22.5 -15 1 100 1 30 0 0;
22 12.95 0 22.5 -15 1 100 1 30 0 0;
22 8.64 0 15 -10 1 100 1 20 0 0;
27 17.12 0 26.25 -17.5 1 100 1 35 0 0;
27 9.79 0 15 -10 1 100 1 20 0 0;
23 10.47 0 15 -10 1 100 1 20 0 0;
23 18.33 0 26.25 -17.5 1 100 1 35 0 0;
13 25.62 0 22.5 -15 1 100 1 30 0 0;
13 29.88 0 26.25 -17.5 1 100 1 35 0 0;
];