writing a callback in a gui

2 ビュー (過去 30 日間)
vedesh Mohit
vedesh Mohit 2020 年 1 月 3 日
編集済み: Ajay Kumar 2020 年 1 月 3 日
How to write a callback for a menu in an GUI for Logic gates like NOT, OR, AND. How to create the operation of these gates? like for instance if the inputs for a OR is both zeros the output is zero & if one of the input is a zero, the output would be a one.

採用された回答

Ajay Kumar
Ajay Kumar 2020 年 1 月 3 日
編集済み: Ajay Kumar 2020 年 1 月 3 日
You can use 3 editfields (2 for x and y inputs and 1 for displaying the output) and 3 buttons (NOT, OR, AND) and you can write callbacks for all these buttons. For example the call back for AND button would look something like:
if editfield1.Value == editfield2.Value
if editfield1.Value == 1
editfield3.Value == "1"
else
editfield3.Value == "0"
end
else
editfield3.Value == "0"
end

その他の回答 (0 件)

カテゴリ

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