Displaying message in static text box

6 ビュー (過去 30 日間)
hi  hey
hi hey 2017 年 6 月 22 日
回答済み: hi hey 2017 年 6 月 22 日
I have duration and distance.
I want to place duration in one static box so that I can call it from a push button to do a calculation
I want to place distance in another static box.
I wrote this code and it gives me what I want but in the command window I get errors.
CODE:
Direct= {'28 hours'};
Directt= {'(2,967 km)'};
while { (val==2)
set(handles.text27,'String', Direct);
set(handles.text29,'String', Directt);
}
CODE ERROR: Conversion to logical from cell is not possible.
Error in Elevation>popupmenu1_Callback (line 287) while{(val==2)
Error in gui_mainfcn (line 95) feval(varargin{:});
Error in Elevation (line 42) gui_mainfcn(gui_State, varargin{:});
end

採用された回答

hi  hey
hi hey 2017 年 6 月 22 日
Got it
if(val==2) set(handles.text29,'String', Direct) & set(handles.text27,'String', Directt); end
I just used the & symbol to help fix the issue

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by