Member of the spectral analysis and the statistics classes.
r = corrcoef(x)
r = corrcoef(x, y)
[r, p, rlo, rup] = corrcoef(x, 'alpha', a, 'rows', s)
[r, p, rlo, rup] = corrcoef(x, y, 'alpha', a, 'rows', s)
Computes the correlation coefficients.
| Name | Description | ||||||
| x | Specifies observations for each variable. If you specify r = corrcoef(x), x can be real or complex. If you specify [r, p, rlo, rup] = corrcoef(x, 'alpha', a, 'rows', s), x must be real. x is a vector or matrix. If x is a vector, each element in x is an observation. If x is a matrix, each row in x is an observation, and each element in the row is data for that observation. | ||||||
| y | When x is a vector, y specifies the data values for each observation in x. When x is a matrix, you cannot specify y. y is an array of the same length as x. | ||||||
| 'alpha' | Tells LabVIEW that the next listed input is a. | ||||||
| a | Specifies the confidence level 1-a. a is a real number in the interval [0, 1]. The default is 0.05. | ||||||
| 'rows' | Tells LabVIEW that the next listed input is s. | ||||||
| s | Specifies how to handle values of NaN in x. s is a string that accepts the following values.
|
| Name | Description |
| r | Returns the correlation coefficients. |
| p | Returns the p-values for the null hypothesis. p is a matrix. |
| rlo | Returns the lower bound for the confidence interval of each coefficient. rlo is a matrix. |
| rup | Returns the upper bound for the confidence interval of each coefficient. rup is a matrix. |
If you specify both inputs x and y, LabVIEW computes the correlation coefficients according to the following equation: r = corrcoef([x(:), y(:)]).
R = corrcoef(rand(5, 6))
R = corrcoef(rand(5, 1), rand(5, 1))
[R, P, RLO, RUP] = corrcoef(rand(5, 6))