Matlab plot x[n] signal

Posted on 2007-07-21
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
    LVL 3

    Assisted Solution

    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

    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

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    zeroMAx challenge 20 66
    Exam question 48 90
    Windows Batch File - Count Down 4 31
    Access question - internal training 9 35
    How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
    The purpose of this article is to demonstrate how we can use conditional statements using Python.
    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…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now