a='C:\code'. cd 'C:\code' works fine but cd a gives error: Name is nonexistent or not a directory
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Zeynab Mousavikhamene
el 11 de Oct. de 2019
Comentada: Zeynab Mousavikhamene
el 11 de Oct. de 2019
How can I pass a "a" as address to change directory not the whole address?
0 comentarios
Respuesta aceptada
Steven Lord
el 11 de Oct. de 2019
The following two cd calls do the same thing, changing directory to a directory named a.
cd a
cd('a')
The following two cd calls do the same thing, changing directory to the directory c:\code.
a = 'c:\code';
cd(a)
cd c:\code
The first set of cd calls does not do the same thing as the second set of cd calls.
See this documentation page for a description of how to use either the command syntax or the function syntax to call a function.
Más respuestas (0)
Ver también
Categorías
Más información sobre Adding custom doc 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!