how to write number into uitable?

1 次查看(过去 30 天)
hello, i have a uitable in a gui application and i want to write a number such as:
x=x0±0.01
with x0 is a number,can you help me with that?
thank you

采纳的回答

Jan
Jan 2017-5-22
编辑:Jan 2017-5-22
"x=x0±0.01" is not a number. You can write this as a string only. Then you can parse the strings when the data are used.
  2 个评论
best16 programmer
best16 programmer 2017-5-22
thank you,but the x0 is a number. can you please show me an example
Jan
Jan 2017-5-22
What about Star Strider's example? I still do not know, what you want to achieve.

请先登录,再进行评论。

更多回答(1 个)

Star Strider
Star Strider 2017-5-22
I would use sprintf to create ‘x’:
x = sprintf('%.2f±0.01', x0);
Change it if necessary to create the result you want.

类别

Help CenterFile Exchange 中查找有关 Numeric Types 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by