フィルターのクリア

Pushbutton values are always equal to 1

3 ビュー (過去 30 日間)
Sam Lee
Sam Lee 2016 年 3 月 28 日
コメント済み: Stephen23 2016 年 3 月 28 日
I've created a MATLAB GUI that contains three push buttons. I am trying to pass the value of each push button to another function in the same M-File to get into a specific loop. The problem is, the value of each push button is always ==1 even if it is not clicked. I am getting no errors and the rest of the code works fine. How can I resolve this issue?
  1 件のコメント
Stephen23
Stephen23 2016 年 3 月 28 日
Please edit your question and show us your code (either in a comment as text, or uploaded as a file).

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

回答 (2 件)

Image Analyst
Image Analyst 2016 年 3 月 28 日
Use checkboxes instead.
checkValue1 = handles.checkbox1.Value;
checkValue2 = handles.checkbox2.Value;
checkValue3 = handles.checkbox3.Value;

Walter Roberson
Walter Roberson 2016 年 3 月 28 日
When you create the uicontrol, are you setting the Value property? If you set the Value property manually then it will stay at that value until the button is clicked.
Possibly you used GUIDE and set the Value to 1 before you saved?

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by