2012-07-15 106 views
0

重命名文件名这是我的代码:错误而尝试在MATLAB

filename_date = strcat('Maayanei_yeshua-IC_',file_date,'.pdf') 
filenamepdf = strcat(filename,'.pdf') 
rename(['C:\Users\user\Desktop\' filenamepdf],['C:\Users\user\Desktop\' filename_date]); 

,我得到的错误:

<??? Error using ==> movefile The system cannot find the path specified.> 

<??? Undefined function or method 'rename' for input arguments of type 'char'.> 

我检查了数百个时间和文件在那里......我不知道为什么它找不到它,有什么帮助?

+0

你为什么试图在MATLAB中做到这一点?为什么不写一个批处理脚本来做到这一点? – 2012-07-15 10:46:02

回答

0

使用命令

doc rename 

地发现rename是与FTP服务器,你是不是在这里做什么工作。你想要的是命令movefile

使用由helpwin提出的帮助窗口来查找您使用的所有命令。

而且,从命令提示符尝试

dir(['C:\Users\user\Desktop\' filenamepdf]) 

确认要移动的文件存在。