MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by anon
on 27 Mar 2013

I have no idea how to do this one.

Please show all working code. Any help will be appreciated.

*No products are associated with this question.*

Answer by Image Analyst
on 27 Mar 2013

Define the arrays like

t = 0:10; v = [40, 42, 45, and so on....

then use Simpson's rule as you learned in class to calculate the distance traveled in each time period and sum them. It may be easiest for you to use a for loop.

## 1 Comment

## the cyclist (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/68849#comment_139357

You may want to read this: http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer