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

Matlab code looking good? EE_Signals

  1. Sep 25, 2007 #1
    1. The problem statement, all variables and given/known data

    Graph of x(t) = 9e^-2t for t>=0 and y(t) = 4e^(-9*pi*t).

    Is my matlab code correct? I did it by hand and I'm getting a different answer, so I dunno which one is the correct one... if my hand one is correctly done or if the matlab one is correct. I'm learning matlab on my own since our professor doesnt require it... he thinks that we'll rely on it too much, but here's my attempt @ it.

    2. Relevant equations

    3. The attempt at a solution

    t = 1:7;
    x = 9*exp(-2*t);
    v = 4*exp(-9*pi*t);
    a = conv(x,v);
    xlabel('values for t')
    ylabel('x(t) * v(t) value')
  2. jcsd
  3. Sep 26, 2007 #2
  4. Sep 29, 2007 #3
    Why are you using convolution when you are only asked to graph the functions?
  5. Oct 1, 2007 #4
    he prob means graph the conv of the two functions.
  6. Oct 2, 2007 #5
    t = 1:7;

    Careful with your vector, you need to set the time instances. 0.01 is usually a good one

    t = 1:0.01:7;
  7. Oct 3, 2007 #6
    Your t value should be dependent on the function's piecewise linear limits. Did you pick a random t value?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook