4.8: Plotting Vectors

Matlab and Octave Programming for STEM Applications · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC-SA 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    4.8: Plotting Vectors

    If you call plot with a vector as an argument, MATLAB plots the indices on the x-axis and the elements on the y-axis. To plot the Fibonacci numbers we computed in Listing 4.1, we’d use

    plot(F)

    Figure 4.1 shows the result.

    4.1.jpg
    Figure 4.1: The first 10 elements of the Fibonacci sequence.

    This way of looking at a vector is often useful for debugging, especially if it is big enough that displaying the elements on the screen is unwieldy.


    This page titled 4.8: Plotting Vectors was last modified on Wed, 13 Jul 2022 23:38:29 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Allen B. Downey (Green Tea Press) via source content that was edited to the style and standards of the LibreTexts platform.