How do I change the directory that MATLAB is initially started in?

http://www.mathworks.cn/support/solutions/en/data/1-17PSD/index.html?product=ML&solution=1-17PSD

How do I change the directory that MATLAB is initially started in?

Problem Description:

Depending on the version of MATLAB the default directory in which MATLAB for the PC starts varies.

As of MATLAB 5.3, MATLAB will start in the $MATLABROOT/work

For previous versions, by default MATLAB starts in $MATLABROOT/bin (where $MATLABROOT denotes the root directory of MATLAB).

Solution:

There are two main ways to change the directory in which MATLAB starts. Note on UNIX the directory is the same as the present working directory.


METHOD 1:

To change the directory in which MATLAB starts, you can use a 'startup.m' file. 

For example if I wished to have all my MATLAB sessions start in D:\my_mfiles then I would place the following CD command in my 'startup.m' file:

cd D:\my_mfiles
For more information on the use of a STARTUP file please refer to the section titled "Starting MATLAB" in the Using MATLAB manual. You can also refer to the Related Solution for information on how to use the STARTUP file to add paths to your MATLAB session.


METHOD 2 (only for Windows):

On the PC you can also set the Shortcut properties of the MATLAB icon to specify a 'Start in' directory. To do so, right-click on the MATLAB icon and select 'Properties'. Select the 'Shortcut' tab and place the directory that you wish to have MATLAB start in into the 'Start in' field of the icon's properties.

在XP下,个人觉得第二种方式更简单实用,只用在快捷方式中更改路径即可。不用再做其他设置
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值