GNU Octave垂直尺寸不匹配

时间:2018-12-08 19:33:31

标签: octave dimensions

我在GNU Octave中遇到以下错误:

error: vertical dimensions mismatch (1x2 vs 1x3) error: called from
ProjectPart1 at line 31 column 4

基于此代码(在zeta(:,1)之后的for / end循环中):

zeta(:,1)=[sum(beta)/lambda,P0];
N=[-lambda,sum(beta);lambda/gen,(rho-sum(beta))/gen];
zeta(:,i)=zeta(:,i-1)+N*zeta(:,i-1)*dt;

我在一个月前运行了此软件,我还记得它能正常工作吗,知道为什么现在不工作吗?

编辑: 这就是全部。我尝试过进行切换,重新启动程序以及重新启动计算机。卸载并重新安装是否值得(因为一位评论者说对他们来说效果很好)?

lam=[0.0128,0.0318,0.119,0.3181,1.4027,3.9286];
beta=[0.000258,0.00152,0.001391,0.00307,0.001102,0.000258];
P0=1e-6;
a=8*sum(beta);
lambda=((beta(1)*lam(1))+(beta(2)*lam(2))+(beta(3)*lam(3))+(beta(4)*lam(4))+(beta(5)*lam(5))+(beta(6)*lam(6)))/sum(beta);
hold off;
box on;
gen=2.6E-5;
dt=.001;
secint=.125/dt;
t(1)=0;
zeta(:,1)=[sum(beta)/lambda,P0];
rho(1)=0
for i=2:secint
N=[-lambda,sum(beta);lambda/gen,(rho-sum(beta))/gen];
zeta(:,i)=zeta(:,i-1)+N*zeta(:,i-1)*dt;
t(i)=t(i-1)+dt;
rho(i)=a*t(i);
end

垂直尺寸错误专门指向此行:

N=[-lambda,sum(beta);lambda/gen,(rho-sum(beta))/gen];

0 个答案:

没有答案