I would like to evaluate the following function
q[beta_, gamma_] := Sum[R[[n, 3]]], {n, 3}];
q[Pi/3, Pi/4]
Over the matrix
R= {{Cos[beta] Cos[gamma], -Sin[gamma],
Sin[beta] Cos[gamma]}, {Cos[beta] Sin[gamma], Cos[gamma],
Sin[beta] Sin[gamma]}, {-Sin[beta], 0, Cos[gamma]}};
This above method, however, does not give any results. I then tried it (besed on Define Function with Sum over a list):
q[beta_, gamma_, R_] := Sum[R[[n, 3]], {n, 1, Length@R}];
q[Pi/3, Pi/4, {R}]
that also did not work. How do I do this?