Mathematics |
Function Summary
A collection of functions provides basic column-oriented data analysis capabilities. These functions are located in the MATLAB datafun
directory.
This section also gives you some hints about using row and column data, and provides some basic examples. This table lists the functions.
Function |
Description |
|
Cumulative product of elements. |
|
Cumulative sum of elements. |
|
Cumulative trapezoidal numerical integration. |
|
Difference function and approximate derivative. |
|
Largest component. |
|
Average or mean value. |
|
Median value. |
|
Smallest component. |
|
Product of elements. |
|
Sort array elements in ascending or descending order. |
|
Sort rows in ascending order. |
|
Standard deviation. |
|
Sum of elements. |
|
Trapezoidal numerical integration. |
To use the Data Statistics Tool to calculate the maximum, minimum, mean, median, range, and standard deviation on plotted data, and create plots of these statistics, see "Using the Data Statistics Tool" in the MATLAB graphics documentation.
Working with Row and Column Data
For vector input arguments to these functions, it does not matter whether the vectors are oriented in row or column direction. For array arguments, however, the functions operate column by column on the data in the array. This means, for example, that if you apply max
to an array, the result is a row vector containing the maximum values over each column.
Basic Examples
Continuing with the vehicle traffic count example, the statements
To locate the index at which the minimum or maximum occurs, a second output parameter can be specified. For example,
shows that the lowest vehicle count is recorded at 02h00 for the first observation point (column one) and at 23h00 and 24h00 for the other observation points.
You can subtract the mean from each column of the data using an outer product involving a vector of n
ones.
Rearranging the data may help you evaluate a vector function over an entire data set. For example, to find the smallest value in the entire data set, use
The syntax count(:)
rearranges the 24-by-3 matrix into a 72-by-1 column vector.
Basic Data Analysis Functions | Covariance and Correlation Coefficients |
© 1994-2005 The MathWorks, Inc.