Why did CD folder; give such a goofy error message when I just forgot ()
Mostra commenti meno recenti
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 Commento
Risposta accettata
Più risposte (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 ...
Categorie
Scopri di più su Results, Reporting, and Test File Management in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!