Using MS-DOS Copy command with Matlab

10 ビュー (過去 30 日間)
Iury
Iury 2015 年 4 月 6 日
コメント済み: Star Strider 2015 年 4 月 6 日
Hi folks,
I am trying to use the copy MS-DOS command with Matlab in order top copy one file from a path to another, but it does not work. I would like to copy the .avl file form this path: ".\Aircraft\GEO\" to this: ".\StudyCases\Wingtip_Geo_Sensibility\aircraft" (Please, see the used code below)
It seems that the string, that results from strcat function does not present the "space" between the paths, what returns the error that "the system could not find the specified path".
aircraft_path_from = strcat('.\Aircraft\GEO\',aircraft,'.avl');
aircraft_path_to = strcat('.\StudyCases\Wingtip_Geo_Sensibility\',aircraft);
space = ' ';
res1 = strcat('copy ',aircraft_path_from);
res2 = strcat(res1,space);
res3 = strcat(res2,aircraft_path_to);
[status,result] =dos(res3);
Could anyone see what i am doing wrong?
Thank you very much! Iury

採用された回答

Star Strider
Star Strider 2015 年 4 月 6 日
編集済み: Star Strider 2015 年 4 月 6 日
I don’t have recent experience with the copyfile function, but if I remember correctly, it may do what you want.

その他の回答 (1 件)

Iury
Iury 2015 年 4 月 6 日
Exactly what I need! Thank you guys!
Good Night for you. Iury
  1 件のコメント
Star Strider
Star Strider 2015 年 4 月 6 日
Always glad to help!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeVariables についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by