Is there a way to run octave offline?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a way to run octave offline?

Mohamed El Dawy-2
Hi,
 I am pretty new to octave. I was wondering, is there a way to run octave totally offline. I need to invoke it from within my program, and grab the results Octave will print to process in my program.
 
I see that running "octave filename", processes the commands in that file, but how can I get the output file? Does octave print to stdout?
 
Thank you very much for all the help.


Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to run octave offline?

Shai Ayal
I think you might try writing the octave results to a file in a format
you can read. than read it from your app.

have a look at the help for the following octave commands:

save
fprintf
fwrite

Shai

Mohamed El Dawy wrote:

> Hi,
>  I am pretty new to octave. I was wondering, is there a way to run
> octave totally offline. I need to invoke it from within my program, and
> grab the results Octave will print to process in my program.
>  
> I see that running "octave filename", processes the commands in that
> file, but how can I get the output file? Does octave print to stdout?
>  
> Thank you very much for all the help.
>
> ------------------------------------------------------------------------
> Yahoo! Messenger with Voice.
> <http://us.rd.yahoo.com/mail_us/taglines/postman3/*http://us.rd.yahoo.com/evt=39666/*http://beta.messenger.yahoo.com>
> PC-to-Phone calls for ridiculously low rates.



-------------------------------------------------------------
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 | Threaded
Open this post in threaded view
|

Re: Is there a way to run octave offline?

Muthiah Annamalai-2
In reply to this post by Mohamed El Dawy-2
you could do any one of these:

1: output redirection

   $ octave my_cool_program.m > my_file_output.txt

2: use the 'fopen' & friends from Octave in your program
    my_cool_program.m and run it. Then just execution of this
    script itself will cause the program to create a new file.

   $ octave my_cool_program.m

3: use execve or friends and overlay your program with Octave
    process and pass your filename as arguments, and then save
    the result whatever you get on stdout into a file using fdup or something.
    Needs some excessive sys-programming ideas.

4: Simply write your program to include octave libraries in C++,
    and compile it. Write your scripts using liboctave classess & functions!


I think fastest solution is #1, or #2.

Muthu


 
Mohamed El Dawy <[hidden email]> wrote:
Hi,
 I am pretty new to octave. I was wondering, is there a way to run octave totally offline. I need to invoke it from within my program, and grab the results Octave will print to process in my program.
 
I see that running "octave filename", processes the commands in that file, but how can I get the output file? Does octave print to stdout?
 
Thank you very much for all the help.

Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.


Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to run octave offline?

Jordi Gutiérrez Hermoso
In reply to this post by Mohamed El Dawy-2
On 3/27/06, Mohamed El Dawy <[hidden email]> wrote:
>
> Hi,
>  I am pretty new to octave. I was wondering, is there a way to run octave
> totally offline. I need to invoke it from within my program, and grab the
> results Octave will print to process in my program.

You could consider using the Octave C++ library, if you're comfortable
coding in C++. The Octave manual contains information on this library.

- JGH



-------------------------------------------------------------
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 | Threaded
Open this post in threaded view
|

Re: Is there a way to run octave offline?

Søren Hauberg
In reply to this post by Mohamed El Dawy-2
Hi,
I'm not quite sure I understand what you're asking about, but yes Octave
prints to stdout. If I run this from the command line:

octave -q --eval "disp('hello')"

The word hello is printed to the screen and I'm back at the command
line. '-q' means quiet (i.e. the octave startup message is not printed),
and '--eval' simply means evaluate the next statement.

/Søren

man, 27 03 2006 kl. 10:40 -0800, skrev Mohamed El Dawy:

> Hi,
>  I am pretty new to octave. I was wondering, is there a way to run
> octave totally offline. I need to invoke it from within my program,
> and grab the results Octave will print to process in my program.
>  
> I see that running "octave filename", processes the commands in that
> file, but how can I get the output file? Does octave print to stdout?
>  
> Thank you very much for all the help.
>
> ______________________________________________________________________
> Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low
> rates.



-------------------------------------------------------------
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 | Threaded
Open this post in threaded view
|

Re: Is there a way to run octave offline?

vicnorton
In reply to this post by Shai Ayal
I do this all the time. I have a perl script named "getWeeklyDataT.pl"
that pulls data off of the Internet and writes it to an octave file
named "spdrRtnDatT.m". Then the perl script executes the line
   `octave "$maindir/Octave/m/$octavescript"`;
The octave script in $octavescript loads "spdrRtnDatT.m", does some
heavy duty computation on this data, and prints the results to another
file. The perl script then reads this file and processes its data
further.

This seems like a very natural kind of process to me. Perl is good at
textual manipulation. Octave is good at computation. They make great
companions.

On 3/27/06, at 2:00 PM +0200, Shai Ayal wrote:
> I think you might try writing the octave results to a file in a format
> you can read. than read it from your app.
>
> Mohamed El Dawy wrote:
> >  I am pretty new to octave. I was wondering, is there a way to run
> > octave totally offline. I need to invoke it from within my program,
> > and grab the results Octave will print to process in my program.



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