Selecting Version for COM server
4 ビュー (過去 30 日間)
Is there a way to select which version of a program an activex server should start up?
For instance for Matlab, if I want to get 2010b is there a way I can
h = actxserver('matlab.application','version','22.214.171.1244');
even if I have 2 or more different versions of Matlab installed?
edurayman 2016 年 3 月 11 日
This is an old thread, but I was trying to figure this today and actually found a solution. According to the documentation (<http://www.mathworks.com/help/matlab/matlab_external/introduction_brd0vd4-1.html)>:
"In order to create an instance of a specific installed and registered MATLAB version, you can use a version-dependent ProgID. For example, using the ProgID Matlab.Application.7.14 creates an instance of MATLAB version 7.14 (R2012a)."
That totally does the work for me. In my case, I have Matlab R2014a and R2015b. I can switch back and forth between the two by using:
matlab = new ActiveXComponent('Matlab.Application.8.3'); % for R2014a
matlab = new ActiveXComponent('Matlab.Application.8.6'); % for R2015b
Alternatively, if you want to select a specific Matlab version by default, you can just type-in regmatlabserver in your selected Matlab version command window (<http://www.mathworks.com/help/matlab/ref/regmatlabserver.html)>.
Hope this helps anyone who is looking into the same issue.
Sachin Ganjare 2012 年 9 月 26 日
According to the matlab documentation:
"Matlab.Application — Starts a command window Automation server with the version of MATLAB that was most recently used as an Automation server (might not be the latest installed version of MATLAB)."
Hence I believe you cannot control the version of Matlab which will be executed.
But there is one way with which you can always invoke most recent version of matlab i.e. to use "Matlab.Autoserver" as progid.
Hope this helps!!!
Walter Roberson 2013 年 1 月 6 日
No there is not, Arvind. Some MATLAB versions predate the existence of ActiveX technology (1996), so there is no command which works for all MATLAB versions.
その他の回答 (0 件)
Find more on ActiveX in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!