修复matlab的文件关联

来源:互联网 发布:软件测试系统 编辑:程序博客网 时间:2024/04/28 20:14

 

 

用matlab改写了一个m-file,可以修复matlab的文件关联,m文件可以直接用editor打开,而不是新开一个窗口。

 

% fix_matlab_filetype.m% fix_matlab_filetype.m% This function helps fix filetype association error of matlab files% By Shengzhen Feng at minidick@163.comcwd=pwd;cd([matlabroot '\toolbox\matlab\winfun\private']);fileassoc('add',{'.m','.mat','.fig','.p','.mdl',['.' mexext]});filename = 'fix_matlab_filetype.reg';fid = fopen(filename,'w');fprintf(fid, 'Windows Registry Editor Version 5.00\n');fprintf(fid, ['[-HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\',...               'CurrentVersion\\Explorer\\FileExts\\.m]\n']);fclose(fid);              dos(['regedit.exe /s ' filename]);cd(cwd);disp(['Changed Windows file associations. FIG, M, MAT, MDL, MEX, ',...      'and P files are now associated with MATLAB.']);


 

原创粉丝点击