pipe output to stdin of a process and capture output
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
In UNIX, I'd simply run the command like so: cat file_to_stdin | ./minDisj other_input_file > output_file.txt
What I'd like to do is run this in MATLAB, with the text normally contained in file_to_stdin being input directly from MATLAB (e.g. I have a cell array I'd like to print in to the stdin) and then capture and process the output that would come from minDisj's stdout.
The system command seems capable of doing everything but directing chosen MATLAB output to the stdin of the process.
Other that potentially using named pipes (fifos), is there an easier alternative?
I can recompile minDisj above to handle its input in other ways, but I'd prefer not to print out to a file first, as this is both messy and slow, and dealing with fifos seems to be overkill (but may be necessary).
0 comentarios
Respuesta aceptada
Walter Roberson
el 16 de Mzo. de 2013
Editada: Walter Roberson
el 16 de Mzo. de 2013
MATLAB has no facility for interactively piping. You need to write to a named pipe, or write to a file and redirect from the file, or write a mex routine that will handle creating the pipes for you. (Caution: if you do that, watch out for MATLAB liking to handle its own buffering.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Encryption / Cryptography en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!