Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have never used matlab before and just started working on my first exercise and don't have a clue what I am doing. I would appreciate any pointers to let me know if what I am doing is write or wrong.

The Question:
Generate and plot the following sequence. In each case the horizontal $(n)$ axis should extend only over the range indicated and should be labels accordingly. Each sequence should be displayed as a discrete-time signal using stem.

$x_1[n]=0.9\delta[n-5] \qquad 1\le n \le 20$

My answer:

EDU>> L=20;
EDU>> nn=0.9:(L-5);
EDU>> stem(nn);

Matlab stem plot

Is this even remotely correct?

share|cite|improve this question
up vote 1 down vote accepted

Presumably $\delta$ refers to the Dirac delta function.


L = 20;
x1 = zeros(1,L);
x1(5) = 0.9;
share|cite|improve this answer

Is $\delta[n]$ a discrete Dirac delta function, i would suppose that, if it does that is absolutely wrong, note that your function is a shifted-scaled version of the original sequence, so your function should be the $\delta[n]$ on 5 with a length of 0.9, If that is not your interpretation of $\delta[n]$, i think you should provide some definitions,. I am thinking and defining stuffs using DSP, digital filters notation

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.