title: Matlab error when opening "An error was encountered while saving the command history"
body: <p>I installed matlab on my linux machine but on a media drive <code>/media/d/usr/local/MATLAB/R2014b</code> but when I open Matlab I get the below error, so if anyone could please advise how to solve this:</p>
  
  <pre><code>An error was encountered while saving the command history
  java.io.FileNotFoundException: /home/userA/.matlab/R2014b/History.xml (Permission denied)
      at java.io.RandomAccessFile.open(Native Method)
      at java.io.RandomAccessFile.&lt;init&gt;(Unknown Source)
      at com.mathworks.mde.cmdhist.AltHistoryCollection$CommandSaver.run(AltHistoryCollection.java:1212)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>