I am running the following code :-
cd E
clc,disp('Hello Neel\n Work hard and Learn More.')
beep off
addpath('C:\Users\USER\Documents\MATLAB\nth')
set(0,'DefaultFigureWindowsStyle','docked')
set(0,'DefaultFigureColormap',jet)
close all
And there is an error in "cd E' and 'Set command'
Following is the error shown in the command window
Error using cd
Cannot CD to E (Name is nonexistent or not a directory).
Error in startup (line 1)
cd E
Can anyone find out the error in the code??
Version:-
MATLAB Version: 8.1.0.604 (R2013a)

Respuestas (2)

Star Strider
Star Strider el 23 de Nov. de 2019

0 votos

The documentation for the cd function, and the error your code threw, should tell you everything you need to know about it.
I have no idea what you want to do, however the fullfile function is likely a much better alternative than cd.

2 comentarios

Neel Shah
Neel Shah el 23 de Nov. de 2019
Thank you,
I gott my answer for 'cd'
Star Strider
Star Strider el 23 de Nov. de 2019
My pleasure.

Iniciar sesión para comentar.

Walter Roberson
Walter Roberson el 23 de Nov. de 2019

0 votos

cd E
That would be an error if there is no subdirectory named E in your current directory.
Note that if you wanted to switch to drive E then you should use
cd('E:')
or better yet, provide a complete path, because when you CD to use a drive letter, CD returns to the last directory that was used for that drive (there is one current directory per drive.)
set(0,'DefaultFigureWindowsStyle','docked')
Correct is
set(0,'DefaultFigureWindowStyle','docked')
Note that this requires a somewhat recent version of MATLAB.

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 23 de Nov. de 2019

Comentada:

el 23 de Nov. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by