How to output a numeric value to a editfield numeric?

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 comentario

num2str(app.machData);
%or
sprintf('%d',app.machData);%change format to your desires

Iniciar sesión para comentar.

Respuestas (1)

Voss
Voss el 15 de Abr. de 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;

Categorías

Más información sobre Communications Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 15 de Abr. de 2022

Respondida:

el 15 de Abr. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by