calling a function only when the check box is clicked

3 ビュー (過去 30 日間)
Aash
Aash 2018 年 5 月 7 日
コメント済み: Dennis 2018 年 5 月 7 日
i have to call a function when push button is pressed only when the check box is ticked. in checkbox call back iahve written following code
if (get(hObject,'Value') == get(hObject,'1'))
linkaxes_sheep();
end
and in push button callback I have written
get(handles.checkbox1,'value')
this is giving error . can someone help
  1 件のコメント
Dennis
Dennis 2018 年 5 月 7 日
You wont need checkboxcallback for this. Add the following condition to your pushbutton callback.
if get(handles.checkbox1,'value') == 1
%do stuff
end
In general please be more specific about your problem. 'this is giving error' can mean alot - best would be to copy paste the entire error message.

サインインしてコメントする。

回答 (0 件)

カテゴリ

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