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

Help with MATLAB problem

Tags:
  1. Feb 4, 2014 #1
    http://i.snag.gy/FBeLq.jpg

    I've figured out the first part, (a), it's the second part (b) that's confusing- I've tried re-arranging the plot() function and also tinkering with y1 and y2 rather than y(t), as I get the error:

    "Subscript indices must either be real positive integers or logicals."

    Any help or advice?
     
  2. jcsd
  3. Feb 5, 2014 #2
    Anyone..?
     
  4. Feb 5, 2014 #3

    kreil

    User Avatar
    Gold Member

    y(t) is functional notation in mathematics. In MATLAB, y(t) means the t-th element in y. In this case t is even a vector of (noninteger) values, so you end up telling MATLAB you want to look at y(0.05), which doesn't make sense since y doesnt have a 0.05th element, only a 1st, 2nd, etc... So just define y = instead of y(t) = .

    I'll get you started..
    y = exp(-t./2).*exp(-2*t);
    x = ...
    plot(t,x)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Help with MATLAB problem
Loading...