% Program 5.6 % R robot arm % Dynamics % Newton-Euler equation of motion % the program uses the function: Rrobot(t,x) % the function is defined in the program Rrobot.m clear; clc; close; time = [0 10]; x0 = [pi/18 0]; [ts,xs] = ode45(@Rrobot, 0:1:10, x0); plot(ts,xs(:,1)*180/pi,'LineWidth',1.5),... xlabel('t (s)'), ylabel('\theta (deg)'), grid, axis([0, 10, 0, 70]) fprintf('Results \n'); fprintf('\n'); fprintf(' t(s) theta(rad) omega(rad/s) \n'); [ts,xs]