フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How do I get the answers from dynamic edit boxes, in order to do calculations?

1 回表示 (過去 30 日間)
Ahmed Khalil
Ahmed Khalil 2017 年 12 月 27 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I was making a GUI which will make multiple text boxes depending on the user input. The code gets the number of stages to make from 'handles.edit1' and then makes the number of boxes accordingly
stages = str2num(get(handles.edit1,'String'));
sdesign = zeros(stages,1);
design = zeros(stages,1);
squantity = zeros(stages,1);
quantity = zeros(stages,1);
srate = zeros(stages,1);
rate = zeros(stages,1);
panel = uipanel('parent',multidesign,...
'Title','Enter Design Rates and Quantity',...
'position',[.01 -.1 0.98 .95]);
for i = 1:stages
sdesign(i,1) = uicontrol('parent',panel,'style','text',...
'string','Design Number:',...
'position',[0 370-i*30 100 20]);
design = uicontrol('parent',panel,'Style','edit',...
'String','',...
'Position',[90 372-i*30 40 20])';
squantity = uicontrol('parent',panel,'Style','text',...
'String','Quantity:',...
'Position',[150 372-i*30 50 20])';
quantity = uicontrol('parent',panel,'Style','edit',...
'String','',...
'Position',[200 374-i*30 40 20])';
srate = uicontrol('parent',panel,'Style','text',...
'String','Rate:',...
'Position',[260 372-i*30 50 20])';
rate = uicontrol('parent',panel,'Style','edit',...
'String','',...
'Position',[300 374-i*30 40 20])';
end
I wanted to know how do I get the data from the multiple boxes since they are dynamic. I just know we have to assign each of them individual tags from which they can be called back. Thanks a lot for your help!

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 12 月 27 日

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by