Question: MATLAB Create a structure array using the table below using direct field notation (ex. structure.field- XX) and/or the struct function. The fields are the following:
MATLAB
Create a structure array using the table below using direct field notation (ex. structure.field- XX) and/or the struct function. The fields are the following: "Name", "Year", "ERA" and "IP" 1. ERA Name: Harang2002,2003,2004 3.54, 4.67, 2.1 Coffey 2002,2003,2004 9.78, 12.1,7.8 Year: IP: 278,192, 56 145, 267, 228 133, 184, 237 121, 280, 275 Valentine 2002,2003,2004 4.56, 1.18, 8.21 Claussen 2002,2003,2004 9.21, 7.38,1.76 a. Create a structure by filling in the fields using the first row of the table above. Call this b. Create 3 more similar structures for the remaining rows. Call these Cof, Val, and c. Add the field "ER" to each structure in the array, and assign a value to each using ER- prob1 Cla. then append each to the structure made in part a to make a 1x4 struct array. ERA *IP/9 (remember that you must access the values of ERA and IP from the previously created structure, for example: prob1(1).ER prob1(1).ERA. *prob1(1).IP/9) Create a structure array using the table below using direct field notation (ex. structure.field- XX) and/or the struct function. The fields are the following: "Name", "Year", "ERA" and "IP" 1. ERA Name: Harang2002,2003,2004 3.54, 4.67, 2.1 Coffey 2002,2003,2004 9.78, 12.1,7.8 Year: IP: 278,192, 56 145, 267, 228 133, 184, 237 121, 280, 275 Valentine 2002,2003,2004 4.56, 1.18, 8.21 Claussen 2002,2003,2004 9.21, 7.38,1.76 a. Create a structure by filling in the fields using the first row of the table above. Call this b. Create 3 more similar structures for the remaining rows. Call these Cof, Val, and c. Add the field "ER" to each structure in the array, and assign a value to each using ER- prob1 Cla. then append each to the structure made in part a to make a 1x4 struct array. ERA *IP/9 (remember that you must access the values of ERA and IP from the previously created structure, for example: prob1(1).ER prob1(1).ERA. *prob1(1).IP/9)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
