Hi all I think this is probably a very basic problem but I cannot figure it out. Here goes.

I need to figure out a user defined function to calculate the grades of any number of students. When I write the script the program calculates the students final grade. There are 10 grades so I know I need to set up a vector however not all 10 grades count toward the final grade equally. So the function to use is given as

where the input argument R is a matrinx in which each row are grades of one student.

So I have no problem figuring out the formula to calculate. The problem is I can only have one argument (R). I need the 1st 6 numbers to be in one part of the formula numbers 7-9 in another part of the formula and the last number in the vector to be in the last part of the formula which all add up to the students final grade by calling the function listed above. I hope this makes sense and thanks in advance for all the help,

John.

• If
R = [9 8 9 7 10 7.8 9.2 6 9 10]

Then
R(1:5) = 9 8 9 7 10
R(6:7) = 7.8000 9.2000
R(8:10) = 9 10