필터 지우기
필터 지우기

Selecting Version for COM server

조회 수: 8 (최근 30일)
Matthew
Matthew 2012년 9월 25일
댓글: edurayman 2016년 3월 11일
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
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
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
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
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 CenterFile Exchange에서 ActiveX에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by