% Example 12-7: Car crash and safety bumper global K m K = 30; m = 1500; v0 = 25; % Vector to define the interval of solution xspan = [0:0.2:3]; % Solve the ODE [x v] = ode45(@bumper, xspan, v0) % Plot the result plot(x, v) xlabel('x (m)'); ylabel('Velocity (m/s)')