The numbers on the listbox do not look the way I want.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Muhendisleksi
el 18 de Ag. de 2017
Comentada: Muhendisleksi
el 18 de Ag. de 2017
my kod:
set(handles.listbox1,'String',x,'FontSize',12);
x = 3.71044e+06
How can I show it as "x =37104445.345"?
3 comentarios
Adam
el 18 de Ag. de 2017
That still doesn't add anything to the question really. You set a string in the list box. Where is that string defined? Your x there is numeric so you must turn it into a string and how you do that will determine what is shown in the listbox.
Respuesta aceptada
Image Analyst
el 18 de Ag. de 2017
Try this:
x = 3.71044e+06;
s = sprintf('%.3f', x); % Turn x into a string.
handles.listbox1.String = s; % Send string to the listbox control.
Set the fontsize in GUIDE rather than code if you want it to be the same all the time.
Más respuestas (0)
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!