重装系统后,matlab不用重装也是可以直接运行。
同理,matlab移动文件夹后也可以不需重装。但是会有下面两个问题:
1. m, mat, fig, mex, mex32等文件的关联没了。
2. m, mat, fig, mex, mex32等文件的图标没了。
下面的办法可以解决这个问题。
建立文件关联:
方法一:
cwd=pwd;
cd([matlabroot '\toolbox\matlab\winfun\private']);
fileassoc('add',{'.m','.mat','.fig','.p','.mdl',['.' mexext]}); %重点
cd(cwd);
disp('Changed Windows file associations. FIG, M, MAT, MDL, MEX, and P files are now associated with MATLAB.')
方法二:
1.打开matlab,运行 help
2.在help窗口中搜索Utility to Change Windows File Associations
3.找到Utility to Change Windows File Associations的对应解释
4.最后就是直接点击所需的文件关联
方法三:
打开Utility to Change Windows File Associations的简便方法:
如果是Windows平台,在matlab的命令窗口输入以下命令:
web([docroot '/techdoc/matlab_env/f8-8880.html#bq4esi8'])
在该帮助页面的最下面有几个链接,点一下就可以进行文件关联了。