using set in matlab gui (help)
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Abraham Chan
am 14 Mär. 2015
Beantwortet: Image Analyst
am 14 Mär. 2015
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
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 14 Mär. 2015
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu String finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!