help-octave
[Top][All Lists]
Advanced

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

Re: load .m file have error, please help


From: Doug Stewart
Subject: Re: load .m file have error, please help
Date: Sun, 20 Feb 2005 07:26:56 -0500
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Your problem is the wrong use of "load"
Load is for data  --- to load data form a file to a variable in octave.
to run a M file named test.m from octave just type in test at the octave prompt.

Doug Stewart


address@hidden wrote:

for save time to type, I save simple program in .m file, it has no wrong if I type in at octave's command line, but have a lot of mistake if I load that from saved .m file in 2.1.64 cygwin xp, please help
eric
------------------------------------------------------------------------------------- octave:1> load nl2.m
error: load: nl2.m: inconsistent number of columns near line 2
error: load: unable to extract matrix size from file `nl2.m'
octave:1> nl2.m
warning: function name `f' does not agree with function file name `/home/eric lin/nl2.m'
error: `x' undefined near line 1 column 25
error: evaluating binary operator `-' near line 1, column 24
error: evaluating binary operator `^' near line 1, column 30
error: evaluating binary operator `+' near line 1, column 32
error: evaluating binary operator `-' near line 1, column 39
error: evaluating assignment expression near line 1, column 19
error: called from `nl2' in file `/home/eric lin/nl2.m'
octave:1>
------------------
$ cat nl2.m
function z=f(x)  z=[(12-x(1))^2+x(2)^2-15^2, (16+x(2))^2+x(1)^2-25^2];
   endfunction
-----------------




-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

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