Update a gui table based on the input number given

조회 수: 5 (최근 30일)
Vasista Adupa
Vasista Adupa 2020년 7월 23일
답변: Harsha Priya Daggubati 2020년 7월 27일
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

답변 (1개)

Harsha Priya Daggubati
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!

카테고리

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