필터 지우기
필터 지우기

How to open/run/control an .exe application using Matlab on windows OS?

조회 수: 14 (최근 30일)
Gopichandh Danala
Gopichandh Danala 2018년 6월 22일
댓글: Guillaume 2018년 6월 25일
Hi,
I want to run/ control an external *.exe application using Matlab.
I need to pass some commands on open .exe or control some button clicks on .exe
I used system('*.exe') to open the application.
But, I want to then give commands from Matlab to the application like:
Prompt on the application: Enter Y or N:
In this case, I want to use Matlab and enter Y or N.
Another requirement:
Prompt on application: select a file and click OK?
I want to supply filename like file.txt and click OK using Matlab.
I heard actxcontrol or something like this is used for this but not able to find examples of this specfic needs.
Any help,
Thanks,
Gopi

답변 (1개)

Guillaume
Guillaume 2018년 6월 22일
actxcontrol is used to embed com (activex) controls into a matlab GUI. These would not come as .exe but as .dll or .ocx.
actxserver to talk to com server. Possibly, your application does have a com interface which you could use to control it but usually such com interface is not designed to interact with the GUI. If the application does not have a com interface, actxserver can't be used.
Your only option left would then be to use the UI automation framework that comes with .Net (which you can call directly from matlab). That will only work if the application uses standard windows control and follows windows design guidelines. Even then, it's going to be a lot of work and requires a fair bit of reverse engineering.
If the application you want to automate is publicly available give us a link so we can see what options are available.
  댓글 수: 2
Gopichandh Danala
Gopichandh Danala 2018년 6월 22일
편집: Gopichandh Danala 2018년 6월 22일
I found a newer version of app I am using. It can be downloaded by registering here:
The software to download is ROCKIT I attached a sample file to analyse with application.
Now I have many of these text files, I want to use matlab to control these and save outputs at once.
Guillaume
Guillaume 2018년 6월 25일
The page you've linked sort of explain how to talk to the software from matlab. The details are in http://metz-roc.uchicago.edu/MetzROC/software/how-to-call-metz-roc-functions.
This completely bypass the GUI. You would be using loadlibrary to load their dll then use calllib to call whichever function you need after having prepared your inputs/outputs adequately. Exact details to work out yourself from the above documentation. They did have available on demand their own wrapper function to make that easier but as the software is no longer supported, you're out of luck on that front.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Use COM Objects in MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by