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

1 view (last 30 days)
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 Comment
Stephen23
Stephen23 on 10 May 2017
It is easy to set the format using num2str or sprintf.
What have you tried so far?

Sign in to comment.

Answers (1)

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

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!