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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by