I have to create a for loop that retrieve each row and store it in a variable
- ,create a for loop that goes from one to the number of patients (use the size command to determine the number of rows and thus the number of patients) and loop through the rows of the matrix containing the patient heart rate data. Inside your for loop, use indexing and the loop variable to retrieve each row of your patient heart rate data and store it in a variable. Take the average of this variable using the mean function and store this average value in the appropriate location in AverageHR. For instance, if you retrieve the first row, which corresponds to patient1, store the average in the first element of AverageHR, etc.
I created the matrix its 5 rows and 4 columns