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!