Display a result + unit in GUI in ,,static text,, field

2 vues (au cours des 30 derniers jours)
tomyy16
tomyy16 le 7 Août 2012
I've wrote a porgram with a GUI and I can display a numerical result in a ,,static text,, field, but I want to be displayed an unit too. Is it possible with a ,set, command?

Réponse acceptée

Sriram
Sriram le 7 Août 2012
yes... you can!
here is an easy way to do it
%%Just Concatenate :) 100 is the value to display along with the unit
your_display = [num2str(100) 'unit'];
set (handles.text,'string',your_display)
  1 commentaire
tomyy16
tomyy16 le 7 Août 2012
Perfekt!! Thank you very much! ;)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Entering Commands dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by