The error is telling you that MATLAB thinks that the variable that you call maximum is a vector, and that you want to have element k of this vector, but k is not a positive integer, so the expression is not valid.
It looks like you want to find the maximum value of some elements. If so, you should be using the max function for this, not a variable called maximum.
If you include the rest of your code (please use the code button on the MATLAB Answers toolbar to format it nicely) it might be possible to see exactly what is going wrong.
Best Answer