我有以下
x=[0.01:0.01:.1];
y=[1 1 1 1 1 0 0 0 0 0 ];
F=@(x,p) 0.5-(1/Pi)*atan(p(2)*(x-p(1)));
p0=[0.05 10000];
当我运行以下
时[f p]=leasqr(x,y,p0,F)
我得到了
error: Invalid call to options. Correct usage is:
-- Function File: OPT = options ("KEY1", VALUE1, "KEY2", VALUE2, ...)
error: called from:
error: /usr/share/octave/3.6.2/m/help/print_usage.m at line 87, column 5
error: /usr/share/octave/packages/control-2.3.52/options.m at line 68, column 5
error: evaluating argument list element number 1
error: /usr/share/octave/packages/optim-1.2.0/leasqr.m at line 574, column 5
我错过了什么吗?
编辑:更新了优化包。新的错误消息:
error: binary operator `.*' not implemented for `matrix' by `symbolic matrix' operations
error: called from:
error: /usr/share/octave/packages/optim-1.2.2/private/__lm_svd__.m at line 145, column 5
error: /usr/share/octave/packages/optim-1.2.2/leasqr.m at line 582, column 26
答案 0 :(得分:1)
这是一个错误。 根据{{3}}
您可能需要更新optim
包来修复它。第一步是依赖于系统,它将安装工具来编译包,在rpm包名上是不同的。
$ sudo apt-get install liboctave-dev
$ sudo octave
octave> pkg install -forge optim
答案 1 :(得分:-1)
如果您在函数中将“Pi”更改为“pi”,则此代码适用于我。 除了它说“未达成收敛!”