ABSTRACT

This chapter covers the following topics: 4.1 Adding, subtracting, multiplying, dividing values, and raising values to a power 4.2 Using built-in functions to compute the square root, remainder, absolute value,

base of the natural logarithms raised to a power, and the logarithm 4.3 Ordering calculations 4.4 Performing statistical calculations to compute the sum, mean, standard

deviation, variance, correlation, and least-squares fit 4.5 Performing statistical calculations with missing data 4.6 Calculating with matrices 4.7 Using matrix algebra 4.8 Obtaining the max, min, sort, round, floor, and ceiling 4.9 Generating random numbers 4.10 Generating magic squares and calendars 4.11 Practicing calculations

The commands that are introduced and the sections in which they are premiered are as follows:

+ (4.1) – (4.1) * (4.1) / (4.1) ^ (4.1) abs (4.2) exp (4.2) log (4.2) rem (4.2) sqrt (4.2) corrcoef (4.4) sum (4.4) mean (4.4) median (4.4) polyfit (4.4) std (4.4) var (4.4) NaN (4.5) nanmax (4.5) nanmean (4.5) nanmedian (4.5) nanmin (4.5) annstd (4.5) nansum (4.5) nanvar (4.5)

./ (4.6)

.^ (4.6) ceil (4.8) fix (4.8) floor (4.8) max (4.8) min (4.8) round (4.8) sort (4.8) sortrows (4.8) rand (4.9) randn (4.9) randperm (4.9) calendar (4.10) magic (4.10)

4.1 Adding, Subtracting, Multiplying, Dividing Values, and Raising

Values to a Power

In the last chapter we considered how matrices can be created and accessed with MATLAB. In this chapter we consider how calculations can be performed.