Using Java Robot class in Parfeval
조회 수: 2 (최근 30일)
이전 댓글 표시
Now I want to use Java Robot Class in a function. That function will be called by parfeval(), which will be evaluated in background.
- It seems that Java robot class can not be used in parfeval().*
May I kindly know if there is a solution for this problem?
댓글 수: 0
채택된 답변
Edric Ellis
2016년 7월 22일
편집: Edric Ellis
2016년 7월 22일
If you're referring to java.awt.Robot, then this will not work since the MATLAB worker executing the body of the parfeval function is a separate process. You might be better off writing some Java code to spawn a thread to drive the java.awt.Robot.
댓글 수: 2
Walter Roberson
2016년 7월 22일
Possibly you need to import it, or make sure it is on the java class path?
추가 답변 (1개)
Walter Roberson
2016년 7월 22일
Each worker has its own process, and that process has no assigned graphics and no assigned keyboard or mouse. When you use the Java Robot class within that process, there is no keyboard or mouse to simulate presses of.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Java from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!