pop-up menu (GUI,guide)

9 ビュー (過去 30 日間)
Tahani Alajmi
Tahani Alajmi 2022 年 1 月 10 日
コメント済み: Tahani Alajmi 2022 年 1 月 10 日
hi,
I have a school project, I need to use Matlab GUI to create a calculator and unit converter i used Guide
I have a problem in unit conversion code, I keep getting the error "Unknown function or 'main list' variable."
and nothing appears in the output screen.
I appreciate the help, thanks in advance for your time.
i'll attach the code

採用された回答

Walter Roberson
Walter Roberson 2022 年 1 月 10 日
Before
if mainList=='temperature'
if innerList1=='Celsius'
if innerList2=='Fahrenheit'
insert
mainList_options = handles.mainList.String;
mainList_value = handles.mainList.Value;
innerList1_options = handles.innerList1.String;
innerList1_value = handles.innerList1.Value;
innerList2_options = handles.innerList2.String;
innerList2_value = handles.innerList2.Value;
%at this point you really should check to be sure that the _value
%variables are not empty: if they are then it means nothing has been
%selected in that list.
%check for empty here
%then
mainList = string( mainList_options{mainList_value} );
innerList1 = string( innerList1_options{innerList1_value} );
innerList2 = string( innerList2_options{innerList2_value} );
  1 件のコメント
Tahani Alajmi
Tahani Alajmi 2022 年 1 月 10 日
Thank you for responsing to my question.
Can you please explain more on how can i check if the var are empty or not?
i added the options on the pop-up menu in the guide window do i need to add it somewhere else?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

製品


リリース

R11.1

Community Treasure Hunt

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

Start Hunting!

Translated by