2.1: How to Create a Script File and Valid File Names

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.

    2.1: How to Create a Script File and Valid File Names

      MATLAB file names follow the same rules as variable names:

      • MATLAB file names must start with a letter.
      • The rest of the name can be letters, numbers or the underscore symbol.
      • The letters can be upper or lower case.
      • No spaces are allowed.
      • No special characters are allowed, except for an underscore.

      These are valid file names:

      • BrickVolume.m
      • My_1st_file.m
      • clever_File_123.m

      These are not valid file names:

      These videos show how to create scripts (m-files) in MATLAB and in Octave.

      How to create a script M-file in MATLAB, Robert Talbert:

      How to create a script M-file in MATLAB, Robert Talbert: [www.youtube.com]

      How to Create a MATLAB Script, Mathworks: (The 1st 2 minutes are the most important.)

      Mathworks script instructions [www.mathworks.com]

      (This also mentions how to create "Live Editor" .mlx files. For most of the assignments in this course, that is more advanced than we need.)

      Octave Programming Lesson 4.1 - Script File Basics, Hanshaw Virtual University

      How to save a file in Octave:

      Octave Programming Lesson 4.1 - Script File Basics, Hanshaw Virtual University [www.youtube.com]

      .

       

      Primer script - 3 - Octave


      This page titled 2.1: How to Create a Script File and Valid File Names was last modified on Sun, 25 Aug 2024 15:11:45 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Carey Smith.