Concept Flow - First MATLAB program
Start MATLAB
Write code: disp('Hello, world!')
Run code
MATLAB prints message
End
This flow shows writing a simple MATLAB program that prints a message and running it to see the output.
disp('Hello, world!')| Step | Action | Code Evaluated | Output |
|---|---|---|---|
| 1 | Start MATLAB environment | ||
| 2 | Write code to display message | disp('Hello, world!') | |
| 3 | Run the code | disp('Hello, world!') | Hello, world! |
| 4 | Program ends |
| Variable | Start | After disp | Final |
|---|---|---|---|
| No variables used | - | - | - |
disp('message') prints text to the MATLAB command window.
Always enclose text in single quotes.
No variables needed to display simple messages.
Run code by pressing Run or typing the command.
Output appears immediately in the command window.