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

1 回表示 (過去 30 日間)
Yuli Hartini
Yuli Hartini 2017 年 5 月 10 日
コメント済み: Yuli Hartini 2017 年 5 月 12 日
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 件のコメント
Stephen23
Stephen23 2017 年 5 月 10 日
It is easy to set the format using num2str or sprintf.
What have you tried so far?

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2017 年 5 月 11 日
set(handles.edit1, 'String', sprintf('%.4f', pi))

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by