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: Andy Buckle
Subject: Re: Running Octave script from batch file under WIN7
Date: Mon, 26 Mar 2012 15:06:21 +0100

On 25 March 2012 10:54, Magnus <address@hidden> wrote:
> Hello,
>
> I am having the following problem. What I want to do is run an Octave script
> from a batch file.
>
> This is the batch file, with the batch file and the test.m file in the same
> folder.
> C:\Octave\3.2.4_gcc-4.4.0\bin\octave-3.2.4.exe -V test.m
>
> This works fine for me.
>
> Now I am using an Octave script with a parameter to pass the measurement
> data.
> It works fine from Octave like this:
> D:/Octave_Test/test1 test.csv
>
> 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.
>
> Thank you in advance,
> Magnus

Something like this works for me on Win XP.

C:\Octave\3.2.4_gcc-4.4.0\bin\octave-3.2.4.exe --eval "cd
C:\path\to\mfile ; more off ; test1 %1"

This will pass the first arg sent to the batch file and send it on to
your octave function. I ended up using --eval for a good reason that I
subsequently forgot.

-- 
/* andy buckle */


reply via email to

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