I would like to create a user defined edit fields in matlab app. Example if i enter 5 it should show 5 numerical edit fields, similarly for any defined number. Is it possible

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 5월 15일

0 개 추천

Check the code in attached app.

댓글 수: 6

Ashiq Muhammed PE
Ashiq Muhammed PE 2020년 5월 15일
Thank you...It works
Ameer Hamza
Ameer Hamza 2020년 5월 15일
I am glad to be of help!
Ashiq Muhammed PE
Ashiq Muhammed PE 2020년 5월 15일
I have a small problem the app is running on command prompt but i cannot open it in app builder. It is showing 'struct contain reference to non struct array objects'. I am using 2016b. Whats the problem? Thanx in advance
Ameer Hamza
Ameer Hamza 2020년 5월 15일
I created it in R2020a, so there might be some incompatibilities. Now, I exported the file for R2016b. You can try the attached file.
Ashiq Muhammed PE
Ashiq Muhammed PE 2020년 5월 15일
I am really sorry the version is 2016a. Still showing error. Its showing loading error. I am using matlab in mac. Can you share the code itself from code view ?
The following screenshots show the components and the code view. The code is also written as text below
properties (Access = private)
editFieldsH % Description
end
methods (Access = private)
% Button pushed function: CreateButton
function CreateButtonPushed(app, event)
pos = [100 420 100 22];
value = app.Num_fieldsEditField.Value;
delete(app.editFieldsH);
app.editFieldsH = gobjects(1,value);
for i=1:value
app.editFieldsH(i) = uieditfield(app.UIFigure, ...
'Position', pos - [0 40*i 0 0]);
end
end
end

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

추가 답변 (0개)

카테고리

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

질문:

2020년 5월 15일

댓글:

2020년 5월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by