gistlib
main.mfunction totalDistance = calculateDistance(times, velocities) totalTime = times(end) - times(1); totalDistance = trapz(times, velocities) * totalTime; end 163 chars5 lines
function totalDistance = calculateDistance(times, velocities) totalTime = times(end) - times(1); totalDistance = trapz(times, velocities) * totalTime; end
gistlibby LogSnag