%% installation of tbxmanager with all submodels required for MPT
%
clc;
disp('----------------------------------------------');
disp('Installation of MPT using the Toolbox manager.');
disp('----------------------------------------------');
disp(' ');
fprintf(['Choose the installation directory where to install the Toolbox manager.\n',...
'A new folder "tbxmanager" is going to be created in the specified location.\n',...
'If you do not specify the folder, the Toolbox manager will be installed in the current directory.\n']);
% get the installation folder
default_dir = pwd;
c = uigetdir(pwd);
if isequal(c,0);
fprintf(['No directory has been provided.\n',...
'Installing the toolbox manager in the current directory "%s"?\n'],default_dir);
c = default_dir;
end
% create a new directory in that folder
d = [c,filesep,'tbxmanager'];
if isequal(exist(d,'dir'),7)
error('The installation directory "%s" already exists.\nPlease, remove or rename the folder or change the installation path.',d);
end
disp('Creating the directory "tbxmanager".');
out = mkdir(d);
if ~out
error(['An error appear when trying to create the folder "%s".\n',...
'Please, install the Toolbox manager manually.'],c);
end
% enter that directory
cd(d);
% remove MPT2 or YALMIP
disp(' ');
disp('Removing toolboxes that may conflict with MPT from the Matlab path.');
rmpath(genpath(fileparts(which('mpt_init'))));
rmpath(genpath(fileparts(which('yalmipdemo'))));
% download the tbxmanager
disp(' ');
disp('Downloading the Toolbox manager from the internet.');
[f, c] = urlwrite('http://www.tbxmanager.com/tbxmanager.m', 'tbxmanager.m');
rehash;
if isequal(c,0)
error('Could not download the Toolbox manager from the internet. The installation cannot continue.');
end
% install all required modules
tbxmanager install mpt mptdoc cddmex fourier glpkmex hysdel lcp sedumi yalmip
% create the initialization file to set the path
disp(' ');
disp('Creating the initialization file "startup.m".');
p = which('startup.m');
if isempty(p)
p = [d,filesep,'startup.m'];
end
fid = fopen(p,'a');
if isequal(fid,-1)
error(['Could not modify the initialization file "startup.m".',...
'Edit this file in the folder "%s" manually and insert there the line: tbxmanager restorepath.'],p);
end
fprintf(fid,'tbxmanager restorepath\n');
fclose(fid);
disp('File has been created.');
% get back to the original directory
cd(default_dir);
% add path to tbxmanager
disp(' ');
disp('Adding path to Matlab.');
addpath(d);
% save path for future
disp(' ');
disp('Saving path for future sessions.');
status = savepath;
if status
fprintf('Could not save the path to a default location,\nplease provide a location where you want to save the path.');
cn = uigetdir(pwd);
if isequal(cn,0)
disp(' ');
fprintf('No directory specified, saving the path to the current directory "%s".\n\n',default_dir);
cn = default_dir;
end
sn = savepath([cn,filesep,'pathdef.m']);
if sn
error(['Could not save the path automatically.\n',...
'Please, open the "Set Path" button in the Matlab menu and save the path manually to some location.']);
end
end
disp(' ');
disp('Installation finished.');
disp('Next time you start Matlab the toolboxes will be automatically initialized.');
% initialize MPT
disp(' ');
disp('Initializing the MPT.')
mpt_init;
MYvoronoi.zip_泰森_泰森多边形_泰森网格_生成 多边形_生成泰森多边形
版权申诉
5星 · 超过95%的资源 77 浏览量
2022-07-14
04:15:06
上传
评论
收藏 2KB ZIP 举报
我虽横行却不霸道
- 粉丝: 75
- 资源: 1万+
最新资源
- 基于matlab实现字符识别的参考程序,用所用的字体识别率挺高,部分手写的也能识别,但是还不能识别扭曲和倾斜的字符 .rar
- 基于matlab实现指纹识别系统 包括数据库导入、图像选择识别、帮助功能、识别图像可视、gabor滤波可视,实现界面操作.rar
- 基于matlab实现指纹识别,利用gabor滤波器,提取指纹特征,只能呢读取bmp图像.rar
- 基于matlab实现于数字图像相关方法中散斑质量评价
- 基于matlab实现遗传算法和佳点集遗传算法的基本思想和不同点,用遗传算法测试一标准函数 佳点集算法测试一标准函数
- tensorflow-gpu-2.5.1-cp38-cp38-manylinux2010-x86-64.whl
- tensorflow-gpu-2.5.0-cp39-cp39-manylinux2010-x86-64.whl
- tensorflow-gpu-2.5.2-cp39-cp39-manylinux2010-x86-64.whl
- 内含方正小标宋简体、仿宋-Gb2312、黑体、楷体、宋体,五个公文常用字体
- 记忆卡牌游戏源码及可运行文件
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论3