Environment for MATLABs
The MATLAB environment is the desktop where you work, including the Command Window, Editor, Workspace and Current Folder, along with the core data structure, the matrix. Vectors and matrices are created, indexed and combined here, and almost every other MATLAB feature builds on these operations.
Stage: Basics · Part of the MATLAB roadmap · Last reviewed 19 November 2026
What to learn in Environment
- Use the Command Window, Workspace and Editor to run and inspect code
- Create vectors and matrices with colon notation, linspace and zeros
- Index and slice matrices with row and column subscripts
- Tell element-wise operators such as .* from matrix multiplication with *
- Look up function help using the help and doc commands
Environment interview questions
What is the difference between * and .* in MATLAB?
The * operator performs true matrix multiplication, which requires inner dimensions to match. The .* operator multiplies corresponding elements of two arrays of the same size, or compatible sizes. Mixing them up is a common source of dimension errors.
Why does MATLAB index from 1?
MATLAB follows mathematical convention, where the first element of a vector is element 1. This differs from languages like C or Python that start at 0. Remember this when porting code, because off by one mistakes are easy to introduce.
Where Environment fits in the MATLAB roadmap
Environment belongs to the Basics stage (beginner level), which takes about 19 hours. Getting started.
Other units in this stage
Back to the full MATLAB roadmap