Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
Solved

# Matlab plot x[n] signal

Posted on 2007-07-21
Medium Priority
5,289 Views
Hi all, I am new to mathlab. Please warn me if I miss some information for the question.
I see a command window in matlab 7.1.
How can I plot below signal y[n]?
http://s69.photobucket.com/albums/i59/ddlam2/?action=view¤t=signal.png
0
Question by:ddlam

LVL 3

Assisted Solution

asood314 earned 240 total points
ID: 19539221
Matlab has built-in plotting functions.  If you go to the help menu and look up "plot", you should be able to find a plotting function that accepts two arrays as parameters.
0

LVL 37

Accepted Solution

Harisha M G earned 260 total points
ID: 19577298
PLOT function is used for continuous domain functions.

For discrete domain functions, as is the case now, you should use STEM function

So, the command will be something like (I don't have MATLAB installed, so I have not checked it)

> n=-5:0.5:5;
> x(n)=exp(j*(0.4*pi*n-0.5*pi));
> y(n)=x(n)-x(n-1);
> stem(y,n)
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilationâ€¦
This article will show, step by step, how to integrate R code into a R Sweave document
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Botâ€¦
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
###### Suggested Courses
Course of the Month15 days, 5 hours left to enroll