请高人看看这个程序错在哪里
同步电机设计中交轴电枢反应磁场幅度系数曲线查找程序,总是出错,不知错在哪里,请高人指点一二。源程序如下:
clc;clear;
ZZAAS=[2.440 2.020 1.740 1.480 1.240
2.200 1.880 1.640 1.420 1.200
2.030 1.780 1.580 1.380 1.160
1.920 1.700 1.520 1.320 1.140
1.800 1.630 1.460 1.300 1.130
1.720 1.580 1.420 1.270 1.120
1.660 1.520 1.380 1.240 1.110
1.610 1.480 1.360 1.230 1.100
1.570 1.440 1.340 1.220 1.100
1.540 1.420 1.300 1.200 1.100];
ZZAAB=;
ZZAAH=;
=lagd(ZZAAB,ZZAAH,ZZAAS',5,10,0.70,0.05)
% 二元线性查值子函数lagd()
function =lagd(X,Y,Z,N,M,U,V)
for j=1:M
for i=1:N
Z1(i)=Z(i,j);
end
=lag(N,X,Z1,U);
Z2(j)=CC;
end
=lag(M,Y,Z2,V);
% 一元线性查值子函数lag()
function =lag(M,XX,YY,X)
j=M-1;
for i=1:j
if X<=XX(i+1)
C=YY(i)+(X-XX(i))*(YY(i+1)-YY(i))/(XX(i+1)-XX(i));
break;
end
end
如果主程序的最后一行是
=lagd(ZZAAB,ZZAAH,ZZAAS',5,10,0.70,0.05),刚程序可以计算,
但如果改成
=lagd(ZZAAB,ZZAAH,ZZAAS',5,10,0.75,0.05)或者
=lagd(ZZAAB,ZZAAH,ZZAAS',5,10,0.72,0.05)什么的,刚提示出错。 Error in ==> lag at 3
j=M-1;
??? Output argument "C" (and maybe others) not assigned during call to
"K:\笔记本电脑文件\小型三相凸极同步发电机\lag.m>lag".
Error in ==> lagd at 7
=lag(N,X,Z1,U);
Error in ==> Untitled at 14
=lagd(ZZAAB,ZZAAH,ZZAAS',5,10,0.72,0.05)
页:
[1]