When programming, whether it is for statistical analysis of for experimental design we will be doing a lot of mathematical operations. For example, at the MATLAB command line type:
2 + 2
and hit Enter
2 + 2
and hit Enter
We will be doing a lot more with variables in the next tutorial. For now, we will review the basic MATLAB mathematical operators. Make sure you try them out in the command window.
4 - 2
subtraction
4 * 2
multiplication
4 / 2
division
4^2
exponent
4E2
scientific notation
log(4)
natural logarithm
Indeed, pretty much every mathematical operation is available in MATLAB. A complete review of all of the mathematical operators in MATLAB is beyond the scope of this tutorial but a fairly comprehensive list is available here:
https://www.mathworks.com/help/matlab/operators-and-elementary-operations.html
Also note, you can use the help command to find out what commands do. Try
help log
Move onto Tutorial 1.3 when you are ready.
4 - 2
subtraction
4 * 2
multiplication
4 / 2
division
4^2
exponent
4E2
scientific notation
log(4)
natural logarithm
Indeed, pretty much every mathematical operation is available in MATLAB. A complete review of all of the mathematical operators in MATLAB is beyond the scope of this tutorial but a fairly comprehensive list is available here:
https://www.mathworks.com/help/matlab/operators-and-elementary-operations.html
Also note, you can use the help command to find out what commands do. Try
help log
Move onto Tutorial 1.3 when you are ready.