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

Small Help in MatLap ( square matrix ? )

  1. Dec 22, 2009 #1
    Small Help in MatLap ( square matrix ?!? )

    how can i solve this problem

    as iam a beginner in the matlap :)

    the main question is

    plot the following discrete functions

    1- x[n]=0.7^n*u[n] -5<n<17

    plz help me thanks in advance
  2. jcsd
  3. Dec 22, 2009 #2
    Re: Small Help in MatLap ( square matrix ?!? )

    plz help i need it urgently :)
  4. Dec 23, 2009 #3


    Staff: Mentor

    Re: Small Help in MatLap ( square matrix ?!? )

    I'm pretty sure you mean matlab.
    Your variable n is an array, so you need to use the element-by-element power operator, which is .^

    Also, you are setting u to 1 in the second line, above, but u appears to be an array in the third line. You're going to run into another problem with u(n), since the index of an array has to be an integer >= 1. IOW, the value of n must be an integer >= 1 in an expression u(n).

    Here's a link to some documentation on MATLAB. I have found it to be pretty helpful.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook