Setting static text to equal a variable

7 vues (au cours des 30 derniers jours)
Samuel Crofts
Samuel Crofts le 1 Déc 2018
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.

Réponse acceptée

Jos (10584)
Jos (10584) le 1 Déc 2018
a = 100 ;
StaticText = sprintf('Health = %d', a)

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by