grades_incl_final=[cellstr(data.StudentID) cellstr(data.Name) num2cell(grades) num2cell([computeFinalGrades(grades)]')]; array=[grades_incl_final]; table=array2table(array); table.Properties.VariableNames = {'StudentID' 'StudentName' 'Assignment1' 'Assignment2' 'Assignment3' 'FinalGrade'} disp(table)
Hi This code creates the table that you can see in the attached picture. My problem is that I want to be able to put more than three assignments into the table. In other words the headings should change depending on the amount of assignments in the 'data' file. If it is easier it is okay if the heading for the assignments are just 1,2,3,4… Can someone tell me how I can do this?
Best Answer