Respuesta :
Hi, you haven't provided the programing language in which you need the code, I'll just explain how to do it using Matlab, and you can apply a similar method for any programming language.
Answer:
attendanceValues = [attendanceValues(2:end),attendanceValues(end)]
Explanation step by step:
- We take all the values of the array from the second position until the end, in this case, we use attendanceValues(2:end) for that.
- We take the last value of the array using attendanceValues(end).
- We create a single array based on the result of step one plus step two.
- We save the new array in the old one reusing attendanceValues.
The program written shifts the row array of attendance values one position to the left, the program written in python 3 goes thus :
attendanceValues = [10, 20, 30, 40]
#the variable attendanceValues is a list of integers
shiftedValues = attendanceValues[1:], attendanceValues[-1]
#using list slicing, the value is selected from index 1 till the end and the last index value is added.
print(shiftedValues)
#displays the values in the shiftedValues list.
Learn more : https://brainly.com/question/15584303