开发者

passing gradient to sqp

I'm trying to provide a gradient when using sqp in Octave but I keep getting a "syntax error". What is the problem? 开发者_StackOverflow社区Thank you.

sqp(0.5*ones(10,1), 
    { @(w) phi(w, g_beta, g_eta, sigmas, estXtpv),
      @(w) gradphi(w, g_beta, g_eta, sigmas, estXtpv) },
    @(w) 0,
    @(w) 0);

The error I get is

parse error near line 193 of file ...

  syntax error

>>>  { @(w) phi(w, g_beta, g_eta, sigmas, estXtpv),
           ^

If I remove {} and remove the gradient (gradphi), then the syntax error disappears.

I'm using Octave 3.2.4.


It seems to be a bug. Try without space i.e. {@(w)phi(w, ... .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜