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


Matlab plot x[n] signal

Posted on 2007-07-21
Medium Priority
Last Modified: 2016-02-10
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]?
Question by:ddlam

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.
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)

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question