Is there a function like cat in MATLAB that can be used to concatenate two files into a third file?
6 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2019 年 2 月 7 日
コメント済み: Walter Roberson
2019 年 2 月 7 日
Is there a function like "cat" in MATLAB that can be used to concatenate two files into a third file?
採用された回答
MathWorks Support Team
2019 年 2 月 7 日
There is no builtin MATLAB command like the "cat" utility command that will concatenate files into a new one. However, you can use the "system" function in MATLAB to execute operating system commands, such as "cat". For example, to concatenate two TXT files into a third one in MATLAB, the following code snippet using the "system" function will work:
>> command = 'cat test1.txt test2.txt > test3.txt';
>> status = system(command);
The above code snippet executes the command to concatenate the first two files into a new file. For more information about how to use the system function in MATLAB, please view the documentation page linked below:
1 件のコメント
Walter Roberson
2019 年 2 月 7 日
Note: cat is a Unix / Posix utility, available in Mac and Linux. For Windows alternatives see https://superuser.com/questions/434870/what-is-the-windows-equivalent-of-the-unix-command-cat
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Cell Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!