3.11: Chapter Review

Matlab and Octave Programming for STEM Applications · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    Read aloud

    How

    Speed: 1×
    Light up
    Highlight

    Symbols: Mulberry Symbols, © 2018–2026 Steve Lee, CC BY-SA 4.0 (licence, the set), the site's own copies.

    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.

    3.11: Chapter Review

    In this chapter, we used a loop to perform a repetitive computation—updating a model 30 times—and to compute sequences and series. Also, we used the plot function to visualize the results.

    Here are some terms from this chapter you might want to remember.

    Absolute error is the difference between an approximation and an exact answer. Relative error is the same difference expressed as a fraction or percentage of the exact answer.

    A loop is part of a program that runs repeatedly. A loop variable is a variable that gets assigned a different value each time through the loop. A range is a sequence of values assigned to the loop variable, often specified with the colon operator—for example, 1:5. The body of a loop is the set of statements inside the loop that runs repeatedly. An accumulator is a variable that is used to accumulate a result a little bit at a time.

    In mathematics, a sequence is a set of numbers that correspond to the positive integers. The numbers that make up the sequence are called . A series is the sum of a sequence of elements. Sometimes we compute the elements of a sequence recurrently, which means that each new element depends on previous elements. Sometimes we can compute the elements directly, without using previous elements.

    Generalization is a way to make a program more versatile, for example, by replacing a specific value with a variable that can have any value. Incremental development is a way of programming by making a series of small, testable changes. Scaffolding is code you write to help you program or debug but that is not part of the finished program.

    In the next chapter, we’ll use a vector to store the results from a loop.


    This page titled 3.11: Chapter Review was last modified on Wed, 13 Jul 2022 23:38:19 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.