Thanks Olaf.
Yes, there is a 'bounds'-option, bounding variable between a min and a max, as well as a 'inequc'-option which allows specifying linear constraints via a matrix and a vector.
I assume that the 'bounds'-option is a subset of the 'inequc'-option.
I installed the packages by downloading from
http://octave.sourceforge.net/optim/index.html and
http://octave-miscellaneous.sourcearchive.com/
then 'sudo octave'
then 'pkg install xxx.tar.gz' for both packages.
(This only an info for not-so-octave-experienced people like me)
On SuSE 11.2 that is quite a job, having to resolve several dependency-issues. Still working on that :-/
On Ubuntu 9.10 it is much easier. Only optim-1.0.12 needs to be installed. No issues.
Good so far: afterwards 'help leasqr' shows the bounds-option.
So i modified the script according to the help in 2 different ways, both of which gave results I did not understand
Only the relevant lines of the script are shown, I can also post the whole script.
# test 1:
# ------------------------------------ #
# function with 2 parameters
bounds=[1,2;1,2]
[f,p,kvg,iter,corp,covp,covr,stdresid,Z,r2]=leasqr(x,y,pin,F,bounds);
# ------------------------------------ #
This worked but gave wrong results (not fitting the pregenerated test-data) AND the results were not within the bounds.
# test 2:
# ------------------------------------ #
# function with 2 parameters
options.bounds=[1,2;1,2]
[f,p,kvg,iter,corp,covp,covr,stdresid,Z,r2]=leasqr(x,y,pin,F,options);
# output:
error: binary operator `-' not implemented for `scalar' by `struct' operations
error: evaluating binary operator `-' near line 316, column 13
error: evaluating binary operator `*' near line 316, column 19
error: evaluating assignment _expression_ near line 316, column 10
error: evaluating for command near line 305, column 3
error: called from `leasqr' in file `/usr/share/octave/packages/3.0/optim-1.0.12/leasqr.m'
error: near line 20 of file `tmp/non-lin.02.scr'
error: Permission denied
# ------------------------------------ #
This did not work at all, as you can see.
Probably a syntax-error.
Thanks
stn