title: How to define a custom directory so that I can cd directory in Matlab
body: <p>Suppose I have a directory</p>
  
  <pre><code>cur = 'C:\Windows\debug';
  </code></pre>
  
  <p>Then I can run <code>cd(cur)</code> now. But I'm not used to using the function format. I hope I can use <code>cd cur</code> to change the current folder directly. Is this possible in MATLAB?</p>
  
  <p>Edit: Because I'm getting the following error:</p>
  
  <pre><code>&gt;&gt; cur = 'C:\Windows\debug';
  &gt;&gt; cd cur
  Error using cd
  Cannot CD to cur (Name is nonexistant or not a directory).
  </code></pre>