how can I store the uieditfiled's value in a variable?

조회 수: 1 (최근 30일)
Palma Errico
Palma Errico 2021년 2월 22일
댓글: J. Alex Lee 2021년 2월 23일
I built an array from code view of app designer ,like this:
g= app.GridLayout;
a=2;
% fill array
lbl1 = uilabel(g);
lbl1.Text = 'Array 1 ';
lbl1.FontSize = 16;
lbl1.Layout.Row = 2;
lbl1.Layout.Column = 1;
for i=1:a
ef = uieditfield(g,'numeric');
ef.Layout.Row = 2;
ef.Layout.Column = i+1;
ef.FontSize = 14;
end
The question I would like to ask is the following: how can I store the uieditfiled's value in a variable?
  댓글 수: 1
J. Alex Lee
J. Alex Lee 2021년 2월 23일
You should do
For i = a:-1:1
ef(i) = ...
end
Then you can access the value of each by it's index
ef(i).Value

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

답변 (0개)

카테고리

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

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by