Setting static text to equal a variable

6 ビュー (過去 30 日間)
Samuel Crofts
Samuel Crofts 2018 年 12 月 1 日
回答済み: Jos (10584) 2018 年 12 月 1 日
I am struggling to figure out how to make the static text equal a variable i have defined, and that will change depending on the actions by the user. For example. What i want it to say is 'Health = 100' But 100 is the starting value of the variable, so the static text is actually Health = a ,where a= 100.

採用された回答

Jos (10584)
Jos (10584) 2018 年 12 月 1 日
a = 100 ;
StaticText = sprintf('Health = %d', a)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by