# Homework Help: Calculating distance using matlab

1. Feb 28, 2013

### Mdhiggenz

1. The problem statement, all variables and given/known data
The speed of a race car during the first seven seconds of a race is given by:
t(s)=0,1,2,3,4,5,6
v(mi/h)=0,14,39,69,95,114,129

Calculate the distance of the first 6 seconds.

What I did is q=trapz(t,v)=395.5

Where did I go wrong?

2. Relevant equations

3. The attempt at a solution

2. Feb 28, 2013

### SteamKing

Staff Emeritus
What are the units of distance? Feet, Miles, Furlongs?

3. Feb 28, 2013

### Staff: Mentor

Looks like miles from the v.

That may be the source of the error. Shouldn't you convert the v values into mi/sec?

4. Feb 28, 2013

### Mdhiggenz

the solution does not specify but I would assume miles.

5. Feb 28, 2013

### SteamKing

Staff Emeritus
Well, if your race car can cover 776.6 miles in 6 seconds, you have quite a machine.

If the solution does not specify units, throw the source material away. It is no good for learning from.

6. Mar 1, 2013

### Staff: Mentor

If the solution doesnt say then why did you write mi/h in the velocity list?

Did you try converting the v values to miles/second and then use the trap function?