How to output a numeric value to a editfield numeric?
Show older comments
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
David Hill
on 15 Apr 2022
num2str(app.machData);
%or
sprintf('%d',app.machData);%change format to your desires
Answers (1)
Voss
on 15 Apr 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;
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!