move file to folder

18 次查看(过去 30 天)
i want function to move file on any dir in my pc to folder at any dir in my pc

采纳的回答

Radha Krishna Maddukuri
Hi Ahmed,
movefile('source','destination')
moves the file or folder named source to the location destination, where source and destination are the absolute or relative paths for the folder or file.
For further information regarding this command, please visit the following documentation page.
  3 个评论
Nathaniel Werner
Nathaniel Werner 2018-1-23
编辑:Nathaniel Werner 2018-1-23
I am trying to do something similar. My code is
movefile filename folderNew
but I get the following error...
Error using movefile
No matching files were found.
I've checked and the file with name 'filename' is in my current folder.
Jan
Jan 2018-1-23
@Nathaniel Werner: Do you really want to move the file called 'filename' to a folder called 'folderNew' or are they file names? The non-functional form of commands can be confusing. Prefer the functional form with parentheses:
movefile(filename, folderNew)
% Or
movefile('FileName.txt', 'NameOfNewFolder')

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by