- Use ActiveX. If using Windows, and using a program that is ActiveX aware, like Microsoft Office applications, then you can use ActiveX to control the program from within MATLAB. I have a demo attached where I do that with Excel.
- Use Java Robot. Basically control the mouse cursor and tell it where to go and what to click on, and control the keyboard to send keystrokes. Demo attached.
- Use an SDK. If your other app has a software development kit, then you can communicate with its DLLs using the loadlibrary() function of MATLAB.
Controlling an external program
조회 수: 31 (최근 30일)
이전 댓글 표시
Matlab noob here looking to understand how to write a matlab script to automatically control another program. Basically I would like to write a matlab code that will open another program and then execute a series of commands in that program that will eventually open a .txt file. Next, I need that .txt file copied to another location. I have very little matlab experience from taking a class at my university, but we didn’t touch on advanced functions like the one I’ve described above. I’ve been searching gui related discussions, but none seem to touch on what I would like to do. This is as far as I’ve gotten: !"C:\Program Files (x86)\HEIDENHAIN\TNCremo\TNCremo.exe" file_browse_button_handle = 'Establish connection'; cb = get(file_browse_button_handle, 'Callback'); cb(file_browse_button_handle, []);
It opens the program, but trying to manipulate the program is where I’m stuck. Any help would be greatly appreciated. Even if you could just point me in the direction of the right threads to read or exactly what I need to search for. Thanks in advance, Brandon
댓글 수: 0
답변 (1개)
Image Analyst
2016년 4월 19일
편집: Image Analyst
2016년 4월 19일
There are 3 options that I know of
댓글 수: 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!