Hi. I apologize if this is a FAQ. I put the following in a file I
named "quaderror.m".
function y = f(x)
y = (cos (x) - 0.5 * (sin (x)).^2 - (cos (x)).^2).^2;
endfunction
But when I type "quaderror" in Octave, I get this:
octave:9> quaderror
warning: near line 9, column 1:
>>> quaderror
warning: function name `f' does not agree with function file name
`/Users/jbthoo/Documents/Work/CompletedWork/Reviews/
PRIMUSreview200412/quaderror.m'
error: `x' undefined near line 2 column 11
error: evaluating argument list element number 1
error: evaluating binary operator `-' near line 2, column 14
error: evaluating binary operator `-' near line 2, column 35
error: evaluating binary operator `.^' near line 2, column 50
error: evaluating assignment expression near line 2, column 3
error: called from `quaderror' in file
`/Users/jbthoo/Documents/Work/CompletedWork/Reviews/
PRIMUSreview200412/quaderror.m'
I don't understand the error messages. When I type the function
directly in Octave, I do not get an error. What am I missing?
TIA.
---John.
-------------------------------------------------------------
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
-------------------------------------------------------------