Matlab: Intefacing with External Program

  • Context: MATLAB 
  • Thread starter Thread starter I_am_learning
  • Start date Start date
  • Tags Tags
    Matlab Program
Click For Summary
SUMMARY

This discussion focuses on interfacing a chess engine executable (Engine.exe) with MATLAB on a Windows platform. The user seeks to send commands like 'isready' to the chess engine and receive responses directly within MATLAB. The suggested solution involves using the MATLAB File Exchange tool "textinject" to send commands to a running external program. However, the user expresses a preference for a more direct messaging approach rather than relying on coordinate-based input.

PREREQUISITES
  • Familiarity with MATLAB programming
  • Understanding of Windows command line operations
  • Basic knowledge of interfacing external applications
  • Experience with MATLAB File Exchange tools
NEXT STEPS
  • Explore the "textinject" MATLAB tool for sending commands to external applications
  • Research MATLAB's system command functions for process management
  • Investigate Windows API for direct communication with external programs
  • Learn about MATLAB's ability to read output from external processes
USEFUL FOR

MATLAB developers, software engineers interfacing with external applications, and anyone interested in automating communication with executable programs.

I_am_learning
Messages
681
Reaction score
16
I have an external program (A chess engine) that I want to interface with matlab. If I double-click the Engine.exe, it runs in a dos window. I can then type in commands like
'isready' and it responds with string such as 'ready'. I want to send command to it from MATLAB and receive the response in matlab.
Anyone knows how to do it?
I am using Windows.
 
Physics news on Phys.org
Yeah! I won't be passing arguments while starting the program. The program will be running separately (doing its calculations). I just want to communicate with it time to time. Your link shows way to type into any running windows program. Thats fine. But it would be more better if I could directly message the program instead of having to specify the co-ordinate for the input field of the program.
Moreover, I also need to read back the text-answer produced by the program.
 

Similar threads

Replies
6
Views
4K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 18 ·
Replies
18
Views
6K