help-octave
[Top][All Lists]
Advanced

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

Re: Running Octave script from batch file under WIN7


From: Jordi Gutiérrez Hermoso
Subject: Re: Running Octave script from batch file under WIN7
Date: Mon, 26 Mar 2012 10:07:45 -0400

On 25 March 2012 05:54, Magnus <address@hidden> wrote:

> However now I am trying to run it from the batch file like this
> C:\Octave\3.2.4_gcc-4.4.0\bin\octave-3.2.4.exe -V test1.m test.csv
>
>
> The Octave file looks like this:
> function test1(filename)
> fid=fopen(filename, "r");
>
> ...
>
> This does not work. Actually nothing happens and I am a little confused
> about it.
> Help would be greatly appreciated.

You're running a function file as a script file. This has the effect
of defining the function as if you typed it in the interpreter, but it
doesn't execute it. You may either (1) write a script and use the argv
function to read arguments from the command line, or (2) tell the
Octave interpreter to execute a function, not to read the function
file as a script, by using the following invocation:

    octave -q --eval 'test1("test.csv");'

I'm not sure about the quoting in the Windows shell, but you basically
have to pass the string inside single quotes as an argument to Octave.

HTH,
- Jordi G. H.


reply via email to

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