Practical 1: Introduction to MATLAB
Elementary Mathematical Functions
Using Mathematical Functions
> Let x=1.2. Verify that the following expressions have the values shown, by typing in the correct MATLAB commands.
|
||
Mathematical expression | Answer | MATLAB command/Tips |
1√2Πe−12x2 | 0.1942 | 1/sqrt(2*pi)*exp(-0.5*1.2^2) |
3√5+cos4x|sin3x| | 3.8866 | (5+cos(4*1.2))^(1/3)/abs(sin(3*1.2)) |
sin2(πx) | 0.3455 | Sets of brackets required: 1 |
esinx√x2+1 | 1.6259 | Sets of brackets required: 3 |
xarctanx−12ln(1+x2) | 0.6053 | Note: you will need to look up the arctangent function in the MATLAB help files (click on Help at the top menu). Sets of brackets required: 3 |