issue with using a variable for path name

10 views (last 30 days)
I tried to save my path address to a variable and use the variable as CD funtion but i am getting an error.
Path = ('H:\dcx_cpe\CRANE\Truck Data');
I am getting the below error.
Cannot CD to H:\dcx_cpe\CRANE\Truck Data\Path (Name is nonexistent or not a directory).
How do i fix this issue?
  1 Comment
Stephen23 on 7 Apr 2022
Do not CD just to import/export data files. CD is slow and makes debugging harder.
Every function that import/exports datafiles accepts absolute/relative filenames. You should use absolute/relative filenames.

Sign in to comment.

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 7 Apr 2022
avoid using 'Path' as variable name as path() is a function.

Sign in to comment.

More Answers (0)




Community Treasure Hunt

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

Start Hunting!