help-octave
[Top][All Lists]
Advanced

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

Re: Running script files


From: Keith Goodman
Subject: Re: Running script files
Date: Sat, 11 Sep 2004 11:38:25 -0700

Enter the command "path" at the Octave prompt to see where Octave is
searching for your script. By default, the first entry in the path is
the current working directory.

You could change the current working directory to be the directory
where your script is located. For example if your script is
c:\octave\script.m, then you would enter "cd c:\oct". Now try to run
your script by entering "script".

Alternatively, without having to change the current working directory,
you could enter "source('c:\oct\script.m') at the Octave prompt. (But
you won't be able to pass in variables.)

Or you could install octave-forge to get the functions addpath and
removepath. Then enter "addpath(''c:\oct\').

Or save the current path as a string (cp = path). Add your path to cp
and then save the new path with path(cpnew).

I'm thinking about writing a text-based, menu-driven program to manage
paths. Here's what the main menu might look like:

octave:1> setpath

Setpath main menu

  [1] Display path
  [2] Add path
  [3] Remove path
  [4] Change path order
  [5] Load path from file
  [6] Quit (confirm or ignore changes) 

Enter command [1-6]: 



----- Original Message -----
From: Vanessa and Charles Nicholls <address@hidden>
Date: Sat, 11 Sep 2004 10:08:37 -0500
Subject: Running script files
To: address@hidden

 
Hi, 
I have just loaded Octave onto my PC. I am a Matlab user and used to
writing .m files in a text editor and then running them from Matlab. I
want to do the same in Octave I have read the online help on this
issue and I am still unable to get my script files to execute. The
help indicates the octave script files,( which I currently am writing
in note pad and saving as .m files), should be located in the
directory asssigned by the LOADPATH variable. I am not clear which
directory this is or how to assign the LOADPATH directory.
  
I would be very grateful for some help on this issue as until I can
run scripts I cannot execute octave programs.
  
Many thanks for any help you can offer on this issue , 
Regards Charles Nicholls.



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