Cannot speak to your simulink model, but the MATLAB code below runs without error.
time = 1:1/100:1000;
theta = -pi/2:pi/(max(time)):pi/2;
x = 5*sin(theta);
drawpendulum(time,theta,x);
drawpendulum(time,theta);
You can put a check in to determine that you have exactly 2 or 3 input args.