<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165327</link>
    <title>MATLAB Central Newsreader - How to change startup directory in Matlab 7.5</title>
    <description>Feed for thread: How to change startup directory in Matlab 7.5</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 18 Mar 2008 05:16:02 -0400</pubDate>
      <title>Re: How to change startup directory in Matlab 7.5</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165327#421411</link>
      <author>Vihang Patil</author>
      <description>"Irian O" &amp;lt;merlingt1@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;frlvsp$dit$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Thank you all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I got it working by editing my startup.m everytime with the &lt;br&gt;
&amp;gt; directory "cd('mydirectory')" which I wish to be in before &lt;br&gt;
&amp;gt; I launch a new Matlab window. It is kind of a nuisance &lt;br&gt;
&amp;gt; because with Matlab 7.0 I never had to do this and it &lt;br&gt;
&amp;gt; automatically knew the last directory I was in. I am not &lt;br&gt;
&amp;gt; sure if it is something that changed or if it is a program &lt;br&gt;
&amp;gt; setting that I am missing.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Cheers!&lt;br&gt;
&amp;gt; Irian&lt;br&gt;
&amp;gt; &lt;br&gt;
You can try this simple utility found here&lt;br&gt;
&lt;a href="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=19239&amp;objectType=file"&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=19239&amp;objectType=file&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
or&lt;br&gt;
&lt;br&gt;
&lt;a href="http://tinyurl.com/3xwbbm"&gt;http://tinyurl.com/3xwbbm&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
HTH&lt;br&gt;
Vihang&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 17 Mar 2008 14:40:25 -0400</pubDate>
      <title>Re: How to change startup directory in Matlab 7.5</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165327#421308</link>
      <author>Irian O</author>
      <description>Thank you all,&lt;br&gt;
&lt;br&gt;
I got it working by editing my startup.m everytime with the &lt;br&gt;
directory "cd('mydirectory')" which I wish to be in before &lt;br&gt;
I launch a new Matlab window. It is kind of a nuisance &lt;br&gt;
because with Matlab 7.0 I never had to do this and it &lt;br&gt;
automatically knew the last directory I was in. I am not &lt;br&gt;
sure if it is something that changed or if it is a program &lt;br&gt;
setting that I am missing.&lt;br&gt;
&lt;br&gt;
Cheers!&lt;br&gt;
Irian&lt;br&gt;
&lt;br&gt;
"Vihang Patil" &amp;lt;vihang_patil@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;frlcsk$3lo$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Irian O" &amp;lt;merlingt1@yahoo.com&amp;gt; wrote in message &amp;lt;fqv437&lt;br&gt;
&amp;gt; $s8b$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi everyone,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I have been the following commands in one of my codes:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; !matlab -nosplash -r myscript &amp;&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; This starts a new instance of Matlab and runs the &lt;br&gt;
script &lt;br&gt;
&amp;gt; &amp;gt; "myscript.m". The problem is that when the new Matlab &lt;br&gt;
&amp;gt; &amp;gt; window opens it starts in the default main Matlab &lt;br&gt;
&amp;gt; directory &lt;br&gt;
&amp;gt; &amp;gt; instead on the current or working directory when I ran &lt;br&gt;
&amp;gt; the &lt;br&gt;
&amp;gt; &amp;gt; "!matlab .... command". Does anyone know how I can &lt;br&gt;
&amp;gt; change &lt;br&gt;
&amp;gt; &amp;gt; it so it remembers in which directory the previous &lt;br&gt;
&amp;gt; working &lt;br&gt;
&amp;gt; &amp;gt; directory?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This is what you need&lt;br&gt;
&amp;gt; doc startup&lt;br&gt;
&amp;gt; doc finish&lt;br&gt;
&amp;gt; doc pwd&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You will need to code your finish.m file in such  a way &lt;br&gt;
&amp;gt; that when you close/exit matlab, it will execute the code &lt;br&gt;
&amp;gt; in it which has the reference to the present working &lt;br&gt;
&amp;gt; directory or pwd and then it outputs that string of the &lt;br&gt;
&amp;gt; pwd to startup.m file&lt;br&gt;
&amp;gt; In your startup file, your code should be something like &lt;br&gt;
&amp;gt; this&lt;br&gt;
&amp;gt; cd('&amp;lt;path string generated from finish.m&amp;gt;')&lt;br&gt;
&amp;gt; HTH&lt;br&gt;
&amp;gt; Vihang&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 17 Mar 2008 09:16:04 -0400</pubDate>
      <title>Re: How to change startup directory in Matlab 7.5</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165327#421248</link>
      <author>Vihang Patil</author>
      <description>"Irian O" &amp;lt;merlingt1@yahoo.com&amp;gt; wrote in message &amp;lt;fqv437&lt;br&gt;
$s8b$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi everyone,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have been the following commands in one of my codes:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; !matlab -nosplash -r myscript &amp;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This starts a new instance of Matlab and runs the script &lt;br&gt;
&amp;gt; "myscript.m". The problem is that when the new Matlab &lt;br&gt;
&amp;gt; window opens it starts in the default main Matlab &lt;br&gt;
directory &lt;br&gt;
&amp;gt; instead on the current or working directory when I ran &lt;br&gt;
the &lt;br&gt;
&amp;gt; "!matlab .... command". Does anyone know how I can &lt;br&gt;
change &lt;br&gt;
&amp;gt; it so it remembers in which directory the previous &lt;br&gt;
working &lt;br&gt;
&amp;gt; directory?&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
This is what you need&lt;br&gt;
doc startup&lt;br&gt;
doc finish&lt;br&gt;
doc pwd&lt;br&gt;
&lt;br&gt;
You will need to code your finish.m file in such  a way &lt;br&gt;
that when you close/exit matlab, it will execute the code &lt;br&gt;
in it which has the reference to the present working &lt;br&gt;
directory or pwd and then it outputs that string of the &lt;br&gt;
pwd to startup.m file&lt;br&gt;
In your startup file, your code should be something like &lt;br&gt;
this&lt;br&gt;
cd('&amp;lt;path string generated from finish.m&amp;gt;')&lt;br&gt;
HTH&lt;br&gt;
Vihang&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 16 Mar 2008 17:50:19 -0400</pubDate>
      <title>Re: How to change startup directory in Matlab 7.5</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165327#421158</link>
      <author>Christophe Boudrie</author>
      <description>"Irian O" &amp;lt;merlingt1@yahoo.com&amp;gt; wrote in message &amp;lt;fqv437&lt;br&gt;
$s8b$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi everyone,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have been the following commands in one of my codes:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; !matlab -nosplash -r myscript &amp;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This starts a new instance of Matlab and runs the script &lt;br&gt;
&amp;gt; "myscript.m". The problem is that when the new Matlab &lt;br&gt;
&amp;gt; window opens it starts in the default main Matlab &lt;br&gt;
directory &lt;br&gt;
&amp;gt; instead on the current or working directory when I ran &lt;br&gt;
the &lt;br&gt;
&amp;gt; "!matlab .... command". Does anyone know how I can change &lt;br&gt;
&amp;gt; it so it remembers in which directory the previous &lt;br&gt;
working &lt;br&gt;
&amp;gt; directory?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks!&lt;br&gt;
&lt;br&gt;
Hi, you may simply send the command "cd" for cd(pwd) "pwd" &lt;br&gt;
is current directory when you invoke the new matlab window:&lt;br&gt;
! matlab -r cd(pwd),my_script...&lt;br&gt;
&lt;br&gt;
Another way is to specify the full path of the file you &lt;br&gt;
which to run:&lt;br&gt;
!matlab -r run('C:\my_folder\my_script.m')&lt;br&gt;
&lt;br&gt;
Finally, if you whish to control matlab when ran, you can &lt;br&gt;
use matlab as an automation server: h = actxserver&lt;br&gt;
('matlab.application'), see matlab help for more details.&lt;br&gt;
&lt;br&gt;
regards,&lt;br&gt;
chris&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 08 Mar 2008 22:31:03 -0500</pubDate>
      <title>How to change startup directory in Matlab 7.5</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165327#419814</link>
      <author>Irian O</author>
      <description>Hi everyone,&lt;br&gt;
&lt;br&gt;
I have been the following commands in one of my codes:&lt;br&gt;
&lt;br&gt;
!matlab -nosplash -r myscript &amp;&lt;br&gt;
&lt;br&gt;
This starts a new instance of Matlab and runs the script &lt;br&gt;
"myscript.m". The problem is that when the new Matlab &lt;br&gt;
window opens it starts in the default main Matlab directory &lt;br&gt;
instead on the current or working directory when I ran the &lt;br&gt;
"!matlab .... command". Does anyone know how I can change &lt;br&gt;
it so it remembers in which directory the previous working &lt;br&gt;
directory?&lt;br&gt;
&lt;br&gt;
Thanks!&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
