Analysis MATLAB Code

% distance of train from center of tracks (centimeters)
r = 7;
for i = 1:100
    omegain(i) = i*.1;
    omegaout(i) = omegain(i)*.5;
    % vel is the linear velocity of th train
    vel(i) = r*omegaout(i);
end
plot(omegain,omegaout,omegain,vel),xlabel('Angular Velocity of Handle (rad/s)'),ylabel('Angular and Linear Velocities of Train'),legend('Angular Velocity (rad/s)','Linear Velocity (cm/s)'),title('Velocities of Train for Input Velocity')