资源简介
解决现在MATLAB文件与软件无法关联的问题,可以实现MATLAB软件相关文件的关联。
代码片段和文件信息
function associateFiles(action userExtList fileStr)
% associateFiles(action extList fileStr)
%
% Makes a registry files that can be used to set correct file associantions on
% a windows platform. The following MATLAB file extensions are supported:
% .m .mat .fig .mexw32 .mexw64 .p .mdl .mdlp .slx .mldatx .req
% .sldd .slddc .slxp .sltx .mn .mu .muphlp .xvc .xvz .ssc .mlapp
% .mlappinstall .mltbx .mlpkginstall .mlprj
%
% INPUT:
% action - optional string.
% * ‘add‘ (default) adds/rewrites the MATLAB file association registry
% keys for this version.
% * ‘delete‘ deletes the MATLAB file association registry entries for
% ALL versions of MATLAB (including “old style“ ones)
% * ‘deleteadd‘ is the same as ‘delete‘ followed by ‘add‘
% extList - optional string or cell array of strings containing the file
% extensions that should be associated with this version. Default is
% all MATLAB file extension (see above).
% fileStr - optional string with the name of the registry file to be written
% (possibly including path). Default is the file
% ‘MatlabFileAssocFix.reg‘ in the current directory.
%
% USAGE:
% 1) Run with desired options (see above). A registry file should have been
% created.
% 2) Exit all running instances of MATLAB.
% 3) Make a backup copy of the windows registry if you need to restore the
% changes see https://support.microsoft.com/en-us/kb/322756
% 4) Double click on the created file (possibly need to enter a password) and
% confirm.
% 5) Restart Windows (or explorer.exe).
% 6) The MATLAB files should now be associated with the MATLAB version that the
% registry file was created in and e.g. m-files should be opened in an
% already running instance of MATLAB.
%
% EXAMPLES:
% * associateFiles(‘deleteadd‘) - Makes a registry files that deletes all
% previous MATLAB file association registry keys and write new ones that
% associates all MATLAB files with the MATLAB version that the registry file
% was created in.
% * associateFiles(‘‘ {‘.m‘ ‘.mat‘ ‘.fig‘} ‘myFile‘) - Makes a registry file
% “myFile.reg“ that associates m- mat- and fig-files with the MATLAB version
% that the registry file was created in.
%
% VERSION 1.0
% Defualt input
if (nargin < 1 || isempty(action))
action = ‘add‘;
end
if (nargin < 2)
userExtList = {};
end
if (nargin < 3)
fileStr = ‘‘;
end
if (~iscell(userExtList))
if (isempty(userExtList))
userExtList = {};
else
userExtList = {userExtList};
end
end
% Sanity check
if (~ischar(action) || (~strcmpi(action ‘add‘) && ...
~strcmpi(action ‘delete‘) && ~strcmpi(action ‘deleteadd‘)))
error(‘The action to perform must be ‘‘add‘‘ ‘‘delete‘‘ or ‘‘deleteadd‘‘!‘)
end
if (~isempty(userExtList) && ~min(cellfun(@ischar userExtList)))
error(‘The file extension list mu
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 14222 2015-06-11 15:57 matlab文件关联方法\associateFiles\associateFiles.m
文件 1524 2015-06-11 15:57 matlab文件关联方法\associateFiles\license.txt
文件 30700 2018-05-07 19:18 matlab文件关联方法\associateFiles\MatlabFileAssocFix.reg
文件 139 2016-04-04 10:34 matlab文件关联方法\associateFiles\readme.txt
目录 0 2018-05-07 19:20 matlab文件关联方法\associateFiles
目录 0 2018-05-07 19:20 matlab文件关联方法
----------- --------- ---------- ----- ----
46585 6
相关资源
- 基于Matlab的摄像头输入的眨眼检测
- matlab2018a下载265821
- matlab的M函数PID
- DW检验算法的matlab代码
- 运用Matlab录音识别过程程序
- QPSK调制与解调在MATLAB上的实现
- matlab神经网络工具箱系统预测
- 基于符号熵的matlab源程序
- matlab 潮流计算软件
- 霍夫变换圆检测MATLAB程序
- PCM编码的MATLAB演示
- 三电平svpwm逆变器仿真(matlabr2009b)
- LDPC码MATLAB程序
- elcentro.mat
- Matlab与单片机通信
- 数据预处理 剔除奇异值点 matlab代码
- PMSM的matlab仿真
- CMC matlab代码
- siltp 纹理特征提取代码 matlab
- MK突变检验MATLAB代码
- Zernike多项式matlab代码
- KNN分类器完整的matlab代码
- 遗传算法优化pid控制器参数的matlab程
- 隐式广义预测控制matlab程序
- JONSWAP海谱模型
- matlab 人工鱼群求解TSP
- MQAM和MPSK误符号率曲线绘制
- 最好用的串口调试助手_MATLAB
- Matlab小波包分解函数
- Matlab自动识别串口设备名称
评论
共有 条评论