Getting error using cd as follows can anyone help??

4 visualizaciones (últimos 30 días)
ANKUSH PUJARI
ANKUSH PUJARI el 8 de Abr. de 2019
Comentada: Guillaume el 8 de Abr. de 2019
Error using cd
Cannot CD to C:\Menus (Name is nonexistent or not a directory).
Error in StirlinGUIDE
Error in gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
Error in StirlinGUIDE

Respuestas (2)

Walter Roberson
Walter Roberson el 8 de Abr. de 2019
I suspect that you have code like
cd C:\Menus and things\somedirectory
Here the exact destination is not important for my explanation but what is important is that the command form of cd was used and that there is a space in the directory name.
When you use command form then spaces mark the end of each argument. Use function form instead
cd('C:\Menus and things\somedirectory')

ANKUSH PUJARI
ANKUSH PUJARI el 8 de Abr. de 2019
Thank you for your answer. Problem is resolved. Actually that error means there is no such directory present in specified location or if it presents software don't have access to it. 1. Check whether the specified directory present at specified location. If it's somewhere else just put it at specified location. 2. Check this directory and TEmP folder is accessible by user profile you are using to run software. If not, allow the access by setting. for that refer to answer for such question which explain that in details.
  1 comentario
Guillaume
Guillaume el 8 de Abr. de 2019
I'm confused why you're answering your own question by giving yourself a set of advice.
"Actually that error means there is no such directory present in specified location"
Well, yes that's exactly what the error message says.

Iniciar sesión para comentar.

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by