フィルターのクリア

How can I store number and string in the same cell in UITable?

3 ビュー (過去 30 日間)
Muhammad Farooq Zia
Muhammad Farooq Zia 2018 年 8 月 9 日
I am trying to store a value in a cell that is something like Sw=0.256, but 'SW=' part is a string while '0.256' is a computed value. Both of these parts have to go in the same cell. Is there a way to do that?

採用された回答

jonas
jonas 2018 年 8 月 9 日
Not if you want the number stored as a double. See this recent thread:
You can of course calculate the number and then store it as a string.
X=0.256;
sprintf('Sw=%g',X)
ans =
'Sw=0.256'
  2 件のコメント
Muhammad Farooq Zia
Muhammad Farooq Zia 2018 年 8 月 9 日
Can i use sprintf('Sw=%g',0.256)
Muhammad Farooq Zia
Muhammad Farooq Zia 2018 年 8 月 9 日
Yes, it works. Thanks a lot man.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by