change simulink m file name issue

1 回表示 (過去 30 日間)
wenchao zhang
wenchao zhang 2023 年 7 月 14 日
コメント済み: wenchao zhang 2023 年 7 月 14 日
hi, i want use script to change the original name to new name, for example from VehicleSpeedLimiterDemand_cal.m ->vehiclespeedlimiterdemand_cal.m, how to do, thanks in advance.

採用された回答

Aman
Aman 2023 年 7 月 14 日
Hi,
The reason for the error is that filesystems are generally case-insensitive. So, a workaround can be to first rename the file to another random name and then change it to a desired name.
originalName = 'VehicleSpeedLimiterDemand_cal.m';
newName = 'vehiclespeedlimiterdemand_cal.m';
movefile(originalName, 'some_other_name.m');
movefile('some_other_name.m',newName);
Hope this helps!
  1 件のコメント
wenchao zhang
wenchao zhang 2023 年 7 月 14 日
thanks,Aman, yes that's go right.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by