필터 지우기
필터 지우기

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 CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by