It is not clear what you want the function to do. What is t? and theta?
If your aim is to apply a fixed transformation of theta and create 2 output variables (dtheta and Trq) you need to specify a "Trq output variable" in the function synthax together with dtheta.
function [dtheta,Trq] = odeFun(t, theta)
Trq = randi([10 25],1,1);
dtheta(2) = -g/l*theta(1)-Trq;