3.matlab Week3
3.matlab Week3
Week 3 Week 2
Session-I Brief Sumup
Mathematical Functions
Some mathematical functions you have used. MATLAB as a programing language
sqrt(x), round(x)
sum(x), sum(x, dim), sum(sum(x))
prod(x), prod(x, dim), prod(prod(x))
max(x), min(x) over array or matrix (column/row)
sin(x), asin(x), log(x), log10(x), exp(x)
Script
List of elementary math functions help elfun ↵
Could be very basic, more like MATLAB as a calculator notepad++, and others.
Earlier, we have executed commands in Command window MATLAB editor –specialized for creating M-files and graphical
which could not be saved or executed several times. MATLAB debugger: Highly recommended
Create a file with list of commands Variables overwritten – Take extreme care
Save the file Commenting scripts--- Very Very Important
Run the file Matrix operations, etc.,
Run scripts from command window
© MR Summer of Core - 2023 31 © MR Summer of Core - 2023 32
Area of trapezoid
Temperature conversion from Fahrenheit to Centrigrade
C = 5/9 X (F - 32).
Output Commands
Control Flow and Operators
disp
fprintf
Control Flow
Control Flow
if
Week 3
If … end, if … else …
end, if elseif … else …
end
not done