How can I call Cygwin command pipeline with the MATLAB 'system' function?
古いコメントを表示
I installed Cygwin on my Windows machine and tried to use the MATLAB 'system' function to execute a pipeline of Linux commands provided by Cygwin. The execution failed, although the same command pipeline worked fine directly in the Cygwin shell. Below is the MATLAB code and the fourth line constructs the command pipeline to be passed to the 'system' function.
>> inputfname = 'input.gz'; % the sample input is attached
>> nlines = 5;
>> outprefix = 'out';
>> pipeline = sprintf('date; gzip -dc %s | sed -n ''2p;4~2p'' | split -a 3 -d -l %d --numeric-suffix=1 --additional-suffix=%s --filter=''gzip > $FILE.gz'' - %s ; date', inputfname, nlines,'_part.txt', outprefix);
>> system(pipeline);
The MATLAB console output said:
'sed' is not recognized as an internal or external command, operable program or batch file.
How can I make this work?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!