rsize'</span>,24)
plot(l*sin(theta),-l*cos(theta),<span class="string">'y.'</span>,<span class="string">'markersize'</span>,14)
plot(0,-2*l,<span class="string">'.w'</span>,<span class="string">'markersize'</span>,0.005)
<span class="comment">% applied torque</span>
plot([0 torque/umax*xmax],[-0.5, -0.5],<span class="string">'g'</span>,<span class="string">'linewidth'</span>,10);
<span class="comment">% immediate reward</span>
reward = 1-cost.fcn(cost,[0, theta]',zeros(2));
plot([0 reward*xmax],[-0.7, -0.7]