I have been provided with a rotation matrix to use:

and have entered the matrix into my function as
theta = radians(theta);
Ry(theta) = [cos(theta) 0 sin(theta); 0 1 0; -sin(theta) 0 cos(theta)];
newpose = pos*Ry(theta);
yet whenever the function reaches this stage it returns the error
??? Subscript indices must either be real positive integers or
logicals.
any help much appreciated
The problem is the
Ry(theta). Call it something likeRy_thetaif you want it to be a variable, or put it in an actual function. This should work:Or – if you want a more reusable solution: