Prolemn with close Matlab folder
Mostrar comentarios más antiguos
Hi everyone,
I have a problemn like the picture. When I use Matlab program, I try to rename the folder containing *.mat files. Although, all files had closed, I can not rename it. Can you help me? Thanks a lot!
Thu Nguyen

3 comentarios
galaxy
el 5 de Nov. de 2019
Because another program still use this folder or files in folder, so you can not modify it's name.
Maybe, you restart Matlab, it will be OK.
If you do not know which program using , please restart machine.
galaxy
el 5 de Nov. de 2019
Your name same my younger sister name.
Which university do you learning ???
Walter Roberson
el 5 de Nov. de 2019
You cannot typically cannot rename a folder that is your current directory.
Respuesta aceptada
Más respuestas (5)
thu nguyen
el 5 de Nov. de 2019
0 votos
2 comentarios
galaxy
el 5 de Nov. de 2019
In Matlab, you can modify any folder's name if this folder is contained in Matlab path.
In this case, maybe you rename after you used files or addpath to this folder. So you can not.
You can check Matlab path by
>> path
Besides, nice to meet you. I am Vietnamese too.
It you have any problems about Matlab, you can ask me
Image Analyst
el 5 de Nov. de 2019
Did you have Windows File Explorer open viewing that folder? That might prevent renaming.
thu nguyen
el 5 de Nov. de 2019
0 votos
1 comentario
galaxy
el 5 de Nov. de 2019
I can’t believe that happened.
Please close all application, folder in your machine and tell me procedure you use MATLAB.
ex:
- open MATLAB

- rename of New Folder to xxx
- error occur
thu nguyen
el 5 de Nov. de 2019
0 votos
4 comentarios
Walter Roberson
el 5 de Nov. de 2019
There should be many more items than that on the path.
You should use
restoredefaultpath
rehash toolboxcache
and then use pathtool to add those D: directories to the bottom of the path, and then save the path.
thu nguyen
el 6 de Nov. de 2019
Walter Roberson
el 6 de Nov. de 2019
Whenever you add functions to the top of the path, they take priority over any built-in functions by the same name. That can lead to problems for a variety of programs, not just when you are using that particular software. If you add to the bottom of the path, then any function names that are duplicated would only be a problem running that particular software.
thu nguyen
el 6 de Nov. de 2019
thu nguyen
el 5 de Nov. de 2019
0 votos
7 comentarios
galaxy
el 5 de Nov. de 2019
Thank you for your reply.
Problems in run_opt.m script, please check again.
although you rmpath, but maybe it still contains use *.mat or figures in Opt_data folder.
If you need to run again, you can change name via script, it will fast
thu nguyen
el 5 de Nov. de 2019
Editada: thu nguyen
el 5 de Nov. de 2019
galaxy
el 5 de Nov. de 2019
After you move files to the new folder, you can use rmdir function for delete old folder
thu nguyen
el 6 de Nov. de 2019
thu nguyen
el 6 de Nov. de 2019
galaxy
el 6 de Nov. de 2019
You received this error because folder not empty.
You need to use rmdir after you use movefile, when Opt_data was empty,
thu nguyen
el 6 de Nov. de 2019
0 votos
2 comentarios
galaxy
el 6 de Nov. de 2019
You use movefile wrong.
You move Opt_data folder to in Opt_data_0 folder.
You need move all files in Opt_data folder only.
You can use as below
cd ('D:\Thu_30-8-2015\Phd\Matlab_program\code-checked\code_demo\Patients\testpatient');
movefile('Opt_data\*','Opt_data_0');
rmdir('Opt_data');
thu nguyen
el 6 de Nov. de 2019
Categorías
Más información sobre File Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!











