How do I actuate a radio button in a button group programmatically.

4 ビュー (過去 30 日間)
Dan
Dan 2018 年 9 月 5 日
回答済み: Akshay Khadse 2018 年 9 月 14 日
I want to create a unit test for my GUI; and therefore would like to call the callback associated with a radio button that is on a button group. The event data for the callback is of type matlab.ui.eventdata.SelectionChangedData. If I were to explicitly call a callback I'd need to create an object of this type ... but I can't seem to do that directly ... I get an error:
Error using matlab.ui.eventdata.SelectionChangedData Cannot access method 'SelectionChangedData' in class 'matlab.ui.eventdata.SelectionChangedData'.
So ... how do I create this object? Or is there a way to programmatically actuate the button group callback such that it will setup the parameters and call the callback for me?

回答 (1 件)

Akshay Khadse
Akshay Khadse 2018 年 9 月 14 日
Can you post your code here?
I would suggest you to refer the documentation for ' uibuttongroup '. There are few examples which might help you.

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by