That's curious.
Looking back at your error, my patch was irrelevant since it didn't
address the case of 'setfield called with an odd number of arguments'.
I just tried minimize on my Debian system without the patch, and
minimize('sin',1) works fine.
So does setfield.
octave:1> setfield()
ans =
{
}
octave:2> setfield('a',1)
ans =
{
a = 1
}
octave:3> setfield([],'a',1)
ans =
{
a = 1
}
octave:4> setfield(struct('b',1),'a',1)
ans =
{
a = 1
b = 1
}
I have no idea why the above do not work for you.
Paul Kienzle
address@hidden
On Jun 4, 2004, at 4:16 AM, Martijn Brouwer wrote:
I made the change Paul suggested to the file
/usr/share/octave/2.1/site/m/octave-forge/optim/minimize.m, but this
made no difference. Then I downloaded octave-forge from cvs and
compared my minimize.m with the one from cvs: they are identical. So
I was wondering whether I had changed the right file. Running 'which
minimize' from the octave prompt showed:
minimize is the user-defined function from the file
/usr/share/octave/2.1/site/m/octave-forge/optim/minimize.m
So it is the right file. There are a few other files containing the
setfield command, but these do not differ from there cvs versions.
When I tried to build octave-forge from cvs I encountered an error.
Now I am building version 2004-02-12. Maybe the problem persists
because I am using the debian packages, and these have some changes
that concern setfield.
I there are people with other suggestions I would be glad to try them.
Bye,
Martijn Brouwer
Paul Kienzle wrote:
Replace 'setfield' with 'struct'. I've done this in CVS.
Paul Kienzle
address@hidden
On Jun 3, 2004, at 5:04 PM, Martijn Brouwer wrote:
Hi,
Minimize is broken:
minimize("f",1)
error: setfield: called with odd number of arguments
This behaviour is independent of the function that is to be
minimised. I have octave 2.1.57 and octave-forge from 2003-06-02,
running on Debian Sarge. Does somebody know how to solve this?
Bye,
Martijn Brouwer
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------