Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How do I integrate a graph in matlab imported from simulink?

  1. Sep 28, 2008 #1
    How do I integrate this in MatLab. I need the correct syntax.
    The formula is:

    HIC = ({[1/(t2-t1)][Sa(t) dt]}^2.5 )(t2-t1) ;condition[t2-t1 less than or equal to 15ms]

    the S is integration sign with limits from t1 to t2

    so it should read (one over t2 minus t1) multiply (integration of a(t) from t1 to t2) and the WHOLE thing power 2.5 and then multiply with (t2 minus t1)

    I exported my graph from simulink's scope. and I tried followings but failed:
    dt = 0.01
    t1 = HeadA.time

    for t1 = 0:0.001:3;
    t2 = t1+ dt;

    I also replaced the integrate with rsums & quad range of syntaxes and they failed as well. Doesn't integrate array or similar sort of error. Any one please please help me with the working syntax. I'm free to provide additional details if required.
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?