This minimal example works under Octave 6.4.0 but throws an error in Octave 7.0.90 (plus, there are a couple of warnings when loading the optim package):

```
pkg load optim
x = (0:0.01:10).';
y = @(p) p(1) + p(2)*sin(2*pi*p(3)*x);
p0 = [0.3 0.5 0.2];
y0 = y([0.37 0.63 0.21]) + (rand(size(x))-0.5);
p_fit = lsqnonlin(@(p) y(p) - y0,p0);
plot(x,[y0,y(p_fit)])
```

I get this error:

```
error: : function called with too many inputs
error: called from
@<anonymous>
__dfdp__ at line 304 column 15
__nonlin_residmin__>@<anonymous> at line 329 column 26
__jacobian_constants__>@<anonymous> at line 121 column 11
__lm_svd__ at line 196 column 9
__nonlin_residmin__ at line 452 column 25
nonlin_residmin at line 98 column 25
lsqnonlin at line 264 column 21
optim_bug at line 9 column 7
```

It seems to boil down to line 316 in __nonlin_residmin__

```
f.f = @ (varargin) f.f (varargin{:}) - obs;
```

which doesn’t seem to be allowed anymore.

# My system

- OS:
**Windows 10 20H2** - Octave version:
**Version 7.0.90** - Installation method:
**Downloaded and installed octave-7.0.90-w64-installer.exe (https://alpha.gnu.org/gnu/octave/octave-7.0.90-w64-installer.exe)**