Update a gui table based on the input number given
1 次查看(过去 30 天)
显示 更早的评论
Hi, I want to create a table of a certain size. Lets say rows are based on a number which I need to give input to the app. and the column is fixed. only one for now.
Is this possible. For now I created manually by writing 5 times the same code .. Please help me getting through this.
Please find the attachment of the mlapp file.
I am thinking to add a for loop for this section to automate it.
v = evalin("base",'original_proj_list'); % To import a variable from our workspace
v = ['Select';v(:,1)];
roll_nos = xlsread("./name_CGPA_2.xlsx");
roll_nos = ['Select';string(roll_nos(:,1))];
%for i = 1 : length(roll_nos)
app.StudentInfoDropDown.Items.i = roll_nos;
app.ProjectInfoDropDown.Items.i = v(:,1);
app.StudentInfoDropDown_2.Items = roll_nos;
app.ProjectInfoDropDown_2.Items = v(:,1);
app.StudentInfoDropDown_3.Items = roll_nos;
app.ProjectInfoDropDown_3.Items = v(:,1);
app.StudentInfoDropDown_4.Items = roll_nos;
app.ProjectInfoDropDown_4.Items = v(:,1);
app.StudentInfoDropDown_5.Items = roll_nos;
app.ProjectInfoDropDown_5.Items = v(:,1);
%end
0 个评论
回答(1 个)
Harsha Priya Daggubati
2020-7-27
Hi,
You can dynamically create a table when '#rows' are given as input in your app. This can be done by placing the code to create a table in the callback associated with the button that has to be clicked when '#rows' are entered.
For proper syntax to create a table:
This example might help you too!
I couldn't make sense of the code, where you are trying to populate every dropdown with same variables 'rollnos'. I can only help you, if you can elaborate on what you wanted to achieve.
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!