フィルターのクリア

using set in matlab gui (help)

1 回表示 (過去 30 日間)
Abraham Chan
Abraham Chan 2015 年 3 月 14 日
回答済み: Image Analyst 2015 年 3 月 14 日
can I mix int and String in one Static Text?
Display=get(handles.dis1,'String');
num = str2num(Display);
if num >10
set(handles.ans1, 'String',{'the number is',num});
end
The output that i want is
the number is num
the above code only display the number is.
num value is missing

採用された回答

Image Analyst
Image Analyst 2015 年 3 月 14 日
Use sprintf() to create a string, then send that string to the GUI with set():
txt = sprintf('The number is %f',num);
set(handles.ans1, 'String', txt);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by