|Subject:||Re: Error in script file, but not in CLI|
|Date:||Fri, 26 Feb 2010 15:15:08 +0000 (UTC)|
It's interesting how our perspective changes over time. In the days when I used the CP/M operating system on my Heathkit H-89, I thought interms of DOS commands. (One day, the monitor when ka-flooey and I had to complete my work based on my memory of the commands and the expected responses. Nowadays, I think in terms of GUI operations. I forgot that Octave operates in a Linux/Unix world, and not in a Windows world. The cd command solved the whole problem. Thanks for suggesting the obvious. I can now stop tearing out my hair and thinking very bad thoughts about the computer.
----- Original Message -----
From: "John W. Eaton" <address@hidden>
To: "Leo Butler" <address@hidden>
Cc: "alaninva" <address@hidden>, address@hidden
Sent: Thursday, February 25, 2010 4:14:49 PM GMT -05:00 US/Canada Eastern
Subject: Re: Error in script file, but not in CLI
On 25-Feb-2010, Leo Butler wrote:
| On Thu, 25 Feb 2010, alaninva wrote:
| < I use Octave 3.2.3_gcc-4.4.0 and notepad++.
| < I tried this code in a script file called ndcm.m
| < n = [25:25:50];
| < d = [5:5:15];
| < c = [0.1:0.1:0.4];
| < defining the matrix terms by using [...], (...), and "bare" numbers. Each
| < time, I get the error " 'ndcm' undefined near line 1 column 1". When I type
| < these same lines in all three formats at the Command Line Interpreter level,
| < there is no error. Thinking that there might be some non-printing
| < characters at the file header, I typed in a new file and got the same error.
| < Thinking that there might be a problem with my installation, I re-installed
| < Octave. No change in behavior.
| < Any ideas?
| help source
| source "ncdm.m"
You should be able to run commnds from a script file just by typing
the name of the script (without the .m suffix). But for that to work,
the script must be in Octave's path. Where are you saving the file
that you create with notepad? What directories are in Octave's path?
To see a list, type
at the Octave prompt. You can change to the directory containing the
Does that help?
|[Prev in Thread]||Current Thread||[Next in Thread]|