Matlab GUI Automation?

后端 未结 2 1407
抹茶落季
抹茶落季 2021-01-20 07:30

Lets say someone made a Matlab GUI using GUIDE. Now I want to use that code in a programmatic environment - that is no human-in-the-loop. What\'s the easiest way for me to \

相关标签:
2条回答
  • 2021-01-20 07:50

    MTALAB GUI is Java GUI. For the GUI automation there is a recent post on the blog of Yair Altman: http://undocumentedmatlab.com/blog/gui-automation-robot/

    Following applies only if you can rewrite the application.

    There is usually no need for any form of GUI automation for such tasks as yours. Application should have following architecture: Model->Business Logic->GUI. Each layer is decoupled from layers above it - Model knows nothing about Business Logic which knows nothing about the GUI. It is then possible to call Business Logic programmatically without even displaying the GUI. Here is an example for MVC implementation in MATLAB.

    For this reason GUIDE should be avoided. There is an undocumented layout manager in MATLAB, there are also some on the file exchange.

    In your case you could put the whole Business Logic outside the GUI Logic making GUIDE callbacks do nothing but call your Business Logic functions.

    0 讨论(0)
  • 2021-01-20 08:10

    Extract form the following post. Use

    guiname('pushbutton', object, eventdata, handles)
    

    to call callbacks in 'guiname'.

    Have you considered using a MVC pattern. Extracting the 'model' from your GUI might leave you with reusable code.

    0 讨论(0)
提交回复
热议问题