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

3 Ansichten (letzte 30 Tage)
Yuli Hartini
Yuli Hartini am 10 Mai 2017
Kommentiert: Yuli Hartini am 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 Kommentar
Stephen23
Stephen23 am 10 Mai 2017
It is easy to set the format using num2str or sprintf.
What have you tried so far?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

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

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by