Variables and Types
- Doubles by default. Numbers are double by default: integer and single types chosen explicitly when memory demands.
- Strings and chars. Modern text uses string arrays: double-quoted, element-wise, distinct from char rows.
- Logical values. Comparisons produce logical arrays: the masks vectorised selection is built on.
Scripts
- Scripts. A script runs commands top to bottom: sharing the base workspace, the exploration format.
- Sections. Double-percent sections split scripts into runnable cells: iterate one block at a time.
- clear discipline. Reproducible scripts start clean: clear assumptions, not inherited workspace debris.
Control Flow
- if and switch. if/elseif/else and switch branch execution: end closing every block.
- Loops. for and while loop: while vectorisation usually replaces them, reading them stays essential.
- Vectorise first. The MATLAB reflex: replace the loop with an array operation: clearer and dramatically faster.
Before and after this level
- Before: Start Here: Matrix-Oriented Programming: MATLAB Environment, Numerical Computing Model.
- Next: Level 2: Matrices & Arrays: Matrix Operations, Indexing, Vectorised Computation.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does MATLAB Level 1: MATLAB Foundations cover?
Variables and Types, Scripts, Control Flow: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Start Here: Matrix-Oriented Programming, which covers MATLAB Environment, Numerical Computing Model.