2
3
4
5
6
7
8
9
10
11
12
13
MEGR 2240
Computational Methods
for Engineers –
MATLAB Review Notes
MATLAB Commands • Euler’s Method • Numerical
Differentiation • Root‐Finding
• Matrix Methods
( 2024–2025 Study Year )
, Table of Contents
MEGR 2240 Computational Methods for Engineers
(2024–2025 Study Year)
__________________________________________________________
[ 1 ] MATLAB Fundamentals
● Variable creation
● Vectors & linspace
● zeros(), size(), length()
● Displaying values (disp)
[ 2 ] Euler’s Method
● General update formula
● Time‐stepping loops
● Using for‐loops with differential equations
● Updating solution vectors
[ 3 ] MATLAB Plotting
● figure, hold on
● plot() formatting (colors, markers, line styles)
● xlabel, ylabel, title
● grid
● Overlaying data points
● Plotting multiple datasets
[ 4 ] MATLAB Coding Examples
● Photodegradation example
● Depth‐of‐water tank example
● Using sin(), log(), and custom equations
● Using comments (%) for documentation
[ 5 ] Matrix Methods
● Creating matrices
● Accessing rows & columns
● Matrix multiplication
● Using linspace inside matrices
● AX = b formulation