pipe output to stdin of a process and capture output
9 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Walter Roberson
2013 年 3 月 16 日
編集済み: Walter Roberson
2013 年 3 月 16 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Encryption / Cryptography についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!