First MATLAB Program

First MATLAB Program
MATLAB is developed by MathWorks.
1: Hello World in MATLAB
Step 1: Open MATLAB Editor
Click New Script
A blank editor window opens
Step 2: Write the Program
Step 3: Save the File
File Name:
hello.mLocation: Current Folder
Step 4: Run the Program
Click Run ▶
Or press F5
Output (Command Window)
2: Simple Addition Program
Output
3: Square of a Number
Output
Program 4: Simple Plot Program
Important Points for Beginners
MATLAB is case-sensitive
Statements end with a semicolon
;to suppress outputScripts are saved with
.mextensionUse
disp()to display text or values
What You Learned
- How to write a MATLAB program
- How to run a script
- How to display output
- Basic calculation & plotting
