Setting static text to equal a variable

6 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Logical 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by