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

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

댓글을 달려면 로그인하십시오.

답변 (1개)

Voss
Voss 2022년 4월 15일
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;

카테고리

도움말 센터File Exchange에서 Communications Toolbox에 대해 자세히 알아보기

질문:

2022년 4월 15일

답변:

2022년 4월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by