Unrecognized method, property, or field 'Value' for class 'matlab.ui​.control.B​utton'.

97 ビュー (過去 30 日間)
dayoung
dayoung 2023 年 9 月 18 日
編集済み: Bruno Luong 2023 年 9 月 18 日
function StartButtonPushed(app, event)
app.modelEditField.Value = bdroot(gcs);
if app.StartButton.Value == 1
app.PauseButton.Value = 0;
app.ContinueButton.Value = 0;
app.StopButton.Value = 0;
end
set_param(app.modelEditField.Value,'SimulationCommand','start');
end
This is my ButtonPushed Function and I think that " app.StartButton.Value == 1 " mean pressed
But when I simulate this
"Unrecognized method, property, or field 'Value' for class 'matlab.ui.control.Button'."
error occured.
Why this error occured..?

採用された回答

Bruno Luong
Bruno Luong 2023 年 9 月 18 日
編集済み: Bruno Luong 2023 年 9 月 18 日
Only state button has property value that you can toggle. It seems you have created a simple push button. See https://www.mathworks.com/help/matlab/ref/uibutton.html
The push button doesn't have state so no property value. It only has a callback that is invoked when the button is pushed.

その他の回答 (1 件)

Mario Malic
Mario Malic 2023 年 9 月 18 日
Correct property that you are looking for is Enabled, instead of Value.

カテゴリ

Help Center および File ExchangeHistorical Contests についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by