• 大小: 4.16MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-29
  • 语言: Matlab
  • 标签: matlab  connector  mobile  

资源简介

使用matlab mobile等与matlab 2011a及以上连接的工具。 使用时解压该文件,执行matlab的cd命令到解压文件夹,运行install_connector来安装,执行connector on,第一次使用输入5个字符以上的连接密码即可。

资源截图

代码片段和文件信息

function install_connector()
%INSTALL_CONNECTOR  Install the MATLAB Connector.
%   INSTALL_CONNECTOR Install the files for the MATLAB Connector into your MATLAB installation.

%   Copyright 2010-2011 The MathWorks Inc.

% turn off connector if running
try
    com.mathworks.util.ClassLoaderBridge.findClass(‘com.mathworks.matlabserver.embeddedwebserver.JettyWebServer‘);
    running = com.mathworks.matlabserver.embeddedwebserver.JettyWebServer.isRunning();
    if running
        connector(‘off‘);
        clear(‘java‘);
    end
catch e %#ok
end

% Determine location of this file
currentFile = mfilename(‘fullpath‘);
[currentDir currentscriptName] = fileparts(currentFile);

% Define variables used in the script
productName = ‘MATLAB Connector‘;
licenseAgreementFile = fullfile(currentDir ‘MATLAB_Connector_SLA.txt‘);
zip_file = ‘MATLABconnector.zip‘;
toolboxStr = ‘toolbox‘;
connectorStr = ‘connector‘;
connectorRoot = fullfile(matlabroot toolboxStr connectorStr);
connectorHelpFile = fullfile(connectorRoot connectorStr ‘html‘ ‘bsjg133.html‘);
helpFileStr = strcat(‘file:///‘ connectorHelpFile);

% make sure user is using at least MATLAB R2009b
if verLessThan(‘matlab‘ ‘7.9‘)
   error(‘%s does not run on MATLAB versions earlier than R2009b.‘ productName);
end

% check if the jvm is available
if (~usejava(‘jvm‘))
    error(‘%s requires Java to run.‘ currentscriptName)
end

% check if archive exists
if (exist(zip_file ‘file‘) ~= 2)
    error(‘Archive %s does not exist.\nInstallation failed.‘ zip_file)
end


% Display License Agreement
if (exist(licenseAgreementFile ‘file‘) ~= 2)
    error(‘The %s license agreement file does not exist on your machine.\nThis is an invalid installation.‘ productName)
end

type(licenseAgreementFile)
reply = input(‘Do you accept this license agreement? Y/N [N]: ‘ ‘s‘);
msg = sprintf(‘You must accept the license agreement if you wish to continue installing. \n...Exiting the %s Installation.‘ productName);
if(isempty(regexpi(reply‘^(y|yes)$‘)))
    disp(msg)
    return
end

doinstall
install_connector_path_update(false);
rehash toolboxcache

% Wrap-up
msg = sprintf(‘\nInstallation of %s is complete.\n‘ productName);
disp(msg)

msg = sprintf(‘To start the connector type \“connector on\“.‘);
disp(msg)

msg = sprintf(‘\nFor more information see the Setup and User‘‘s Guide.‘ helpFileStr);
disp(msg)
end

function doinstall
productName = ‘MATLAB Connector‘;
% check if the user can write to matlabroot
tempFileInMLRoot = tempname(matlabroot);
fid = fopen(tempFileInMLRoot ‘w‘);
if (fid == -1)
    failed = true;
    
    if ispc
        try
            proc = System.Diagnostics.Process;
            % EXE to run
            proc.StartInfo.FileName = fullfile(matlabroot‘bin‘‘matlab‘);
            % Arguments to the EXE
            proc.StartInfo.Arguments = ‘/wait /noslpash /nodesktop /r install_connector_helperexit‘;
            % Run-as admin
            proc.Star

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件     4370919  2011-01-28 10:29  MATLABconnector.zip
     文件        1030  2011-01-28 10:27  install_connector_path_update.m
     文件        4001  2011-01-28 10:27  install_connector.m
     文件        1129  2011-01-28 10:27  install_connector_helper.m
     文件        7741  2011-01-28 10:27  MATLAB_Connector_SLA.txt

评论

共有 条评论