matlab please Problem 1. PART A Create a cell array called ca that will contain the following: [Physics] [14][1 4 -...
Problem 1. PART A Create a cell array called ca that will contain the following: [Physics] [14][1 4 -3 8] [ITim] [Burnett]] [23] [Jessica] [Wul] [3 9 17] [Chemistry] [8 7 2 91 [Literature] [IJavier] [Lopez] [54] As shown above, the cell array ca should contain within the cells of each row: a department name (eg. Physics), integer code (e.g., 14), an array of integers (e.g., [1 4-3 8]), and two sub-cells containing a person's first and last name, respectively PART B Preallocate a struct array called st which should be of size equal to the number of rows of cell array ca, and should contain the following fields: firstname, lastname, department, code, array PART C Looping through cell array ca, assign to the fields of struct array st the corresponding values from ca. Note that the order of information in cell array ca varies from row to row; however, the first name always appears in the first sub-cell, and the last name in the second sub-cell of the containing cell. The following shows an example of what the contents of st(2) should be: S> st (2) ans fi rstname: Jessica lastname: Wu department: Chemistry code: 23 array: 3 9 1 7 Hint: Two MATLAB built-in function that you may find useful for your seript are: ischar and snumeric
Problem 1. PART A Create a cell array called ca that will contain the following: [Physics] [14][1 4 -3 8] [ITim] [Burnett]] [23] [Jessica] [Wul] [3 9 17] [Chemistry] [8 7 2 91 [Literature] [IJavier] [Lopez] [54] As shown above, the cell array ca should contain within the cells of each row: a department name (eg. Physics), integer code (e.g., 14), an array of integers (e.g., [1 4-3 8]), and two sub-cells containing a person's first and last name, respectively PART B Preallocate a struct array called st which should be of size equal to the number of rows of cell array ca, and should contain the following fields: firstname, lastname, department, code, array PART C Looping through cell array ca, assign to the fields of struct array st the corresponding values from ca. Note that the order of information in cell array ca varies from row to row; however, the first name always appears in the first sub-cell, and the last name in the second sub-cell of the containing cell. The following shows an example of what the contents of st(2) should be: S> st (2) ans fi rstname: Jessica lastname: Wu department: Chemistry code: 23 array: 3 9 1 7 Hint: Two MATLAB built-in function that you may find useful for your seript are: ischar and snumeric