change simulink m file name issue

조회 수: 3 (최근 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 CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by