Selecting Version for COM server
2 次查看(过去 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','7.11.0.584');
even if I have 2 or more different versions of Matlab installed?
1 个评论
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!!!
3 个评论
Arvind Pandey
2013-1-6
"Matlab.Autoserver" helps me in one of my application when we have two Matlab version where one is 6.1 & other is 2006b. But this command did not solve the same issue when We have two matlab version where one is 6.1 & other is 2011b. Please suggest if there is any command which works for all the Matlab version to invoke the Default Matlab Version?
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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 ActiveX 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!