9.4: Limitations of load and save

Fundamentals of MATLAB Programming · 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, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    9.4: Limitations of load and save

    load and save are simple, but simple tools usually come with limitations. These functions are best for plain numeric data.

    The main limitations are:

    1. They are mainly used with ASCII text/data files such as .dat or .txt files.

    2. The file must have the same number of values on every line if we want to store it in a matrix.

    3. The data should be numeric when using load in this simple way.

    4. They do not give us much control over formatting, mixed data types, headers, or line-by-line processing.

    For example, the following file would not work well with load because it contains names and numbers:

    Grey Chris 166.2
    Hall David 143.5
    Giovanni Luke 192.4
    Cat Donna 215.1

    This file contains text and numbers. MATLAB cannot store all of this as a regular numeric matrix. For mixed data like this, we need more advanced file input/output functions.


    This page titled 9.4: Limitations of load and save was last modified on Tue, 30 Jun 2026 02:12:02 GMT and is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Zara Noroozi.