1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Calculating distance using matlab

  1. Feb 28, 2013 #1
    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

    answer is 776.6.

    Where did I go wrong?

    2. Relevant equations



    3. The attempt at a solution
     
  2. jcsd
  3. Feb 28, 2013 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    What are the units of distance? Feet, Miles, Furlongs?
     
  4. Feb 28, 2013 #3

    jedishrfu

    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?
     
  5. Feb 28, 2013 #4
    the solution does not specify but I would assume miles.
     
  6. Feb 28, 2013 #5

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    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.
     
  7. Mar 1, 2013 #6

    jedishrfu

    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?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted