help-octave
[Top][All Lists]

## Re: Calling an octave function from a BAT file in windows

 From: Kire Pudsje Subject: Re: Calling an octave function from a BAT file in windows Date: Wed, 14 Dec 2016 18:35:57 +0100

echo 1+1 | path\to\bin\octave-cli
ans =  2

or

make a script eg. testfile.m containing:

argv

argv contains the normal input variables, like in C. No argc, but this is just numel(argv).
And run this with
path\to\bin\octave-cli -qf testfile.m arg1 arg2 arg3

ans =
{
[1,1] = arg1
[2,1] = arg2
[3,1] = arg3
}

2016-12-14 10:33 GMT+01:00 Lars Johansson :
Hi ,

This issue has been up for discussion before, but a quick search did not result in very clear directions?!

Many years ago I used Matlab compiler (on Windows)  to compile a function '[a,b]=myfunction(varargin)'. The result was here an executable 'myfunction.exe' that I called from the command line (or any batch procedure) like

>> myfunction arg1 arg2 arg3

a=

data1
data2
data3
....

b=

data4
data5
data6
....

I am now trying to come up with a BAT file 'myfunction.bat' to do more or less the same thing. Any input would be very much appreciated (here the output is less important than the passing of arguments).

Best regards,

/Lars

_______________________________________________
Help-octave mailing list