MATLAB: Setting static text to equal a variable

helpMATLAB

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.

Best Answer

a = 100 ;
StaticText = sprintf('Health = %d', a)