I am trying to add two numbers in App designer code view and i am getting following error message

조회 수: 8 (최근 30일)
% Callback function: Button, EditField3
function ButtonPushed(app, event)
a = app.EditField;
b = app.EditField2;
c= a + b;
app.EditField3 = c;
I am getting the following error.
Undefined function 'plus' for input arguments of type 'matlab.ui.control.NumericEditField'.

채택된 답변

Dennis
Dennis 2019년 4월 15일
You need to access the value stored in your edit fields:
a = app.EditField.Value;
b = app.EditField2.Value;
c= a + b;
app.EditField3.Value = c;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by