Borrar filtros
Borrar filtros

Set numbers behind the comma in text edit view on gui matlab?

1 visualización (últimos 30 días)
Yuli Hartini
Yuli Hartini el 10 de Mayo de 2017
Comentada: Yuli Hartini el 12 de Mayo de 2017
Im trying to display some output value from my calculations to an edit text box in my GUI window. I want to set 4 numbers behind the comma in text edit view. How I can do that?
  1 comentario
Stephen23
Stephen23 el 10 de Mayo de 2017
It is easy to set the format using num2str or sprintf.
What have you tried so far?

Iniciar sesión para comentar.

Respuestas (1)

Jan
Jan el 11 de Mayo de 2017
set(handles.edit1, 'String', sprintf('%.4f', pi))

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by