help-octave
[Top][All Lists]
Advanced

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

Re: Piping data into Octave


From: David Bateman
Subject: Re: Piping data into Octave
Date: Thu, 20 Nov 2008 10:54:55 +0100
User-agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018)

Carlo de Falco wrote:
On 20/nov/08, at 09:19, Matthias Brennwald wrote:

Dear all

Here's my situation: I need to communicate between Octave and a shell
command. The shell command takes input data from a text file,
processes this data, and sends the result to stdout. I use Octave's
system(...) command to do this. I send the output to a text file
using a pipe. Then, the result data is loaded into Octave by reading
the contents from disk.

The proplem: If the data becomes too large, the above procedure
becomes slow. I guess this could be sped up by omitting the data
transfer through the output file on disk. Can this be done by piping
the data from the external program directly back into Octave? If so:
how? Will this work on Linux, Windows, and Mac OS X?

on unix systems (which includes linux and OSX) you can do this
by using popen

help popen

will give all the info and a nice example.
I don't know whether this works on windows but I am sure other people
on the list can comment on that.

Yes we have a windows version of both popen and popen2 as we use this for gnuplot even on windows..

Cheers
David



--
David Bateman                                address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob) 91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax) The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary



reply via email to

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