具体程序如下,程序运行时出现矩阵越界错误,不知道修改哪里?帮忙看看。
clc
clear
load ui.mat;
m=ui';
ua=m(3501:3900,2)-m(1501:1900,2);
ia=m(3501:3900,5)-m(1501:1900,5);
ub=m(3501:3900,3)-m(1501:1900,3);
ib=m(3501:3900,6)-m(1501:1900,6);
uc=m(3501:3900,4)-m(1501:1900,4);
ic=m(3501:3900,7)-m(1501:1900,7);
Q=1/3*[2 -1 -1 0 sqrt(3) -sqrt(3) 1 1 1 ];
um1=Q(1,:)*[ua ub uc]';
im1=Q(1,:)*[ia ib ic]';
Lm1=0.8984e-3;
Cm1=12.94e-9;
Zcm1=sqrt(Lm1/Cm1);
uf=(um1+im1*Zcm1);
ur=(um1+im1*Zcm1);
uf1=uf';
ur1=ur';
t1=0;10;3990;
t=t1;
plot(t,uf1,'r',t,ur1,'b--')
xlabel('t/us');ylabe1('u/v');
legend('正向行波‘,反向行波’,‘location','northwest');
|