0

我有以下

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
4

2 回答 2

1

这是一个错误。根据邮件列表

您可能需要更新optim包来修复它。第一步是系统相关的,它会安装编译包的工具,就rpm包名不同。

$ sudo apt-get install liboctave-dev
$ sudo octave
octave> pkg install -forge optim 
于 2013-03-11T01:16:09.203 回答
-1

如果您在函数中将“Pi”更改为“pi”,则此代码适用于我。只是它说“没有实现收敛!”

于 2013-05-23T04:55:30.710 回答