This is machine translation

Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Translate This Page

MathWorks Machine Translation

The automated translation of this page is provided by a general purpose third party translator tool.

MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation.

Programming Scripts and Functions

Program files, control flow, editing, debugging

When you have a sequence of commands to perform repeatedly or that you want to
save for future reference, store them in a program file. The simplest type of
MATLAB® program is a script, which contains a set of
commands exactly as you would type them at the command line. For additional
programming flexibility, create functions which accept input and return
outputs. To combine code with embedded output, formatted text, equations, and images
in a single interactive environment, create live scripts or live
functions.