GUI Edit TextBox: display 2 values separated by a space

5 ビュー (過去 30 日間)
PF
PF 2015 年 10 月 1 日
回答済み: Walter Roberson 2015 年 10 月 1 日
I have 2 textbox in my GUI. User needs to enter a range in TextBox_1 (e.g.: 1 5) and second TextBox shows the output with some simple Maths calculation. My current script:
function edit1_Callback(hObject, eventdata, handles)
A = get(handles.edit1,'String');
B = str2num(A{:});
C=2+B;
set(handles.edit2,'String',C);
However, second textbox disappears from GUI when I run this script. May I know which part of the script was written wrongly? Thanks.

採用された回答

Walter Roberson
Walter Roberson 2015 年 10 月 1 日
set(handles.edit2,'String', num2str(C));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDiscrete Math についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by