help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fminunc and for loop


From: Jordi Gutiérrez Hermoso
Subject: Re: fminunc and for loop
Date: Tue, 10 Jul 2012 15:26:02 -0400

On 10 July 2012 14:32, Michael Teitelbaum <address@hidden> wrote:

> Jordian method:
> I received the following error when I inputted your code:
> error: `x' undefined near line 2 column 29
> error: called from:
> error:   midterm at line 2, column 5
> error: evaluating argument list element number 1
> error:   f at line 5, column 5
> error:   /sw/share/octave/3.6.1/m/optimization/fminunc.m at line 149, column
> 6

Ah, oops, the midterm function calls are missing an x parameter,
midterm(A,idx,x) and midterm(A,prev,x);

> Was your code meant to be put directly into octave, or was it kind
> of just a general idea of the type of thing I should try?

A bit of the latter. I was trying to give structure to the programming
task you attempted.

> I don't know enough about programming to write something similar to
> what you sent me.

I'm always distraught a little when people program in Octave and say
they don't know programming or they are not programmers.

Octave code is not black magic you shouldn't attempt to understand.
Octave is a programming language, and the only way to use Octave is to
write and understand programs. If you can do mathematics (and
apparently you can), you can also program.

Do read the Octave manual. It's meant to be pedagogical:

    http://www.gnu.org/software/octave/doc/interpreter/

HTH,
- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]