Question: MATLAB Problem 4: Building a Cell Array Write a function [studentCell]-classCellArray (studentNames, studentIDs, studentGrades) that accepts a 4 x 3 char array of names (studentNames),
MATLAB
Problem 4: Building a Cell Array Write a function [studentCell]-classCellArray (studentNames, studentIDs, studentGrades) that accepts a 4 x 3 char array of names (studentNames), a 4 x 6 char array of student IDs (studentIDs), and a 4 x 3 double array of grades (studentGrades). The function should return a 4 >x 4 cell array (studentCell) with the data in studentNames occupying the all rows of the first column of the cell array studentCell, the data in studentIDs occupying the all rows of the second column of the cell array studentCell, the data in studentGrades occupying the all rows of the third column of the cell array studentCell, and the fourth column containing the mean of the three grades for each student. i.e studentCell (1,4) contains the mean of the data in studentGrades (1,; studentCell (2,4) contains the mean of the data in studentGrades (2,:);etc. A table with sample data is provided below, but the function should work for ANY variable inputs that follow the format specified above. Be sure to verify that your function can handle the same inputs and produce the same outputs as the test cases below. Check both the class and size! Table 1: Sample Data for classCellArray.m Name Ali Yin Joe Jim Student ID G10293 G10498 G10201 G19532 Lab 75, 82,91 90, 100, 89 54, 49, 67 100, 100, 100 Test Cases >> studentNames = [ ' Ali ' ; 'Yin ' ; ' Joe ' ; ' Jim' ] studentNames - Ali Yin Joe Jim >>class (studentNames) ans- char >>size (studentNames) 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
