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

3 vues (au cours des 30 derniers jours)
Yuli Hartini
Yuli Hartini le 10 Mai 2017
Commenté : Yuli Hartini le 12 Mai 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 commentaire
Stephen23
Stephen23 le 10 Mai 2017
It is easy to set the format using num2str or sprintf.
What have you tried so far?

Connectez-vous pour commenter.

Réponses (1)

Jan
Jan le 11 Mai 2017
set(handles.edit1, 'String', sprintf('%.4f', pi))

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by