The model should generate 'N' number of editable input boxes using app design in MATLAB.
Show older comments
I'm creating an app in app designer using Matlab. if I have given my input as '5' in my editfield text, I has to get '5' number of input boxes, After the model creates 5 input boxes, those boxes should be editable where I can give required values in that boxes.
2 Comments
Manikanta Aditya
on 27 Mar 2024
To generate a dynamic number of editable input boxes in App Designer, you can use a combination of uifigure, uigridlayout, and uieditfield components.
function createInputBoxes(numBoxes)
% Create the app figure
appFig = uifigure('Name', 'Dynamic Input Boxes', 'Position', [100 100 300 300]);
% Create a grid layout to hold the input boxes
gridLayout = uigridlayout(appFig, [numBoxes 1]);
% Create an array to store the uieditfield components
inputBoxes = uieditfield(numBoxes, 'numeric');
% Add the input boxes to the grid layout
for i = 1:numBoxes
gridLayout.RowHeight{i} = 'fit';
gridLayout.ColumnWidth{1} = 'fit';
gridLayout.add(inputBoxes(i), i, 1);
end
end
Venu Madhav Puchaginjala
on 27 Mar 2024
Accepted Answer
More Answers (0)
Categories
Find more on Develop Apps Using App Designer 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!