Skip to main content
Logo image

Section 1.4 Variables

A variable in MATLAB is a named location in memory that stores a value. Variables allow you to save data so that it can be reused, modified, and combined with other data as a program runs. Every calculation you perform in the Command Window produces values, and variables allow you to store those values for later use.
At any moment, MATLAB keeps track of all defined variables in an internal memory area called the workspace. You can view these variables in the Workspace panel of the MATLAB Desktop.