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 Comment

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

Sign in to comment.

Answers (1)

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;

Categories

Asked:

on 15 Apr 2022

Answered:

on 15 Apr 2022

Community Treasure Hunt

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

Start Hunting!