Why did CD folder; give such a goofy error message when I just forgot ()
Mostrar comentarios más antiguos
It works other places but suddenly I can change directory
K>> apploc
apploc =
'C:\Users\CPSLab\Documents\OdorChoiceDev\'
K>> cd apploc
Error using cd
Unable to change current folder to 'C:\Users\CPSLab\Documents\OdorChoiceDev\apploc' (Name is
nonexistent or not a folder).
Why did it add the variable name to the value of the variable instead of just reminding me I forgot the parentheses
cd (apploc)
1 comentario
Respuesta aceptada
Más respuestas (1)
Because
cd apploc
is equivalent to,
cd('apploc')
This is a general thing in Matlab function-calling syntax. For any function func() taking char vector arguments, the syntax,
func('arg1','arg2','arg3',...)
is equivalent to,
func arg1 arg2 arg3 ...
Categorías
Más información sobre Results, Reporting, and Test File Management 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!