I moved files into a .... file and can't access them anymore :)

3 ビュー (過去 30 日間)
LO
LO 2021 年 11 月 10 日
編集済み: dpb 2021 年 11 月 14 日
Hi all
I used the function movefile (MATLAB 2018a). My file name is stored in the variable filename.
I run the lines
mkdir('folder_name')
movefile(filename,'folder name')
as a result MATLAB copied some files into that folder... the problem is: that is not a folder but still a file!
due to a typo in the second command (missing underscore), MATLAB created a new file (instead of using the folder name I previously created) and copied some files into it (I can see the size of the file/folder). I tried to change the attributes of the file (to make it into a folder) but I can't, I also tried to open it with explorer or winrar but it does not work. Is there a way to solve this without losing the files ? I have already tried to copy those files out of the fake folder but MATLAB tells me it can't find the file names
  11 件のコメント
Walter Roberson
Walter Roberson 2021 年 11 月 13 日
There are matlab functions that rely on file extensions.
dpb
dpb 2021 年 11 月 14 日
編集済み: dpb 2021 年 11 月 14 日
"... or MATLAB functions such as readXXX that look at the extension to identify the file content type won't work."
Transparently, at least. Most of the new ones have a named parameter as optional input to let the user specify the data content type if the extension is missing or not a recognized one. Some of the older functions may not have such flexibility, but I haven't thought about who those might (or might not) be.
Of course, if try to use the "UseExcel" option, then MS Excel itself will barf if the file extension doesn't match, but that's not MATLAB, per se.

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

回答 (0 件)

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by