How to output a numeric value to a editfield numeric?
Afficher commentaires plus anciens
Hello, I am trying to make a simple GUI in App Designer that takes inputs, runs them trough a set equation and then outputs the value. I havent found any reliable way to output my answer to a numeric editfield. Does anyone have any ideas?
machNumber = app.aData .* app.vData;
app.machData = machNumber;
This runs when I hit a 'Calculate' button, when I hit that same button I also want it to output app.machData.
Thanks!
1 commentaire
David Hill
le 15 Avr 2022
num2str(app.machData);
%or
sprintf('%d',app.machData);%change format to your desires
Réponses (1)
Voss
le 15 Avr 2022
Let's say app.edit_machNumber is your NumericEditField. To make the value of the variable machNumber show up in app.edit_machNumber, you can say:
% calculate machNumber:
machNumber = app.aData .* app.vData;
% output machNumber to app.edit_machNumber:
app.edit_machNumber.Value = machNumber;
Catégories
En savoir plus sur Communications Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!