What this code do?
1 回表示 (過去 30 日間)
古いコメントを表示
I would like to know what this code does?
dos('rm *.ascii');
thanks
0 件のコメント
回答 (2 件)
Geoff Hayes
2014 年 6 月 24 日
In the Command Window type help dos or doc dos. The dos function executes a DOS command and returns the result:
status = dos(command) executes the specified DOS command for Windows® platforms, and waits for the command to finish execution before returning the exit status to the status variable
The command string in this case is rm *.ascii which should remove all files with the ascii extension from the current directory.
2 件のコメント
Geoff Hayes
2014 年 6 月 24 日
I should have indicated that I ran this piece of code on my Mac where the rm command is valid and so will (and did!) remove all files with the ascii extension...
Image Analyst
2014 年 6 月 24 日
編集済み: Image Analyst
2020 年 5 月 4 日
Does that command even work, or does it throw an error?
For DOS, use del instead of rm. Or use the system() function instead of the dos() function.
4 件のコメント
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!