iqr
Interquartile range.
📝Syntax
r = iqr(A)
r = iqr(A, dim)
r = iqr(A, vecdim)
r = iqr(A, 'all')
[r, q] = iqr(...)
📄Description

iqr returns the difference between the third and first quartiles. The optional second output contains the first and third quartiles.

Dimensions can be a scalar dimension, a vector of dimensions, or all.

A can be a real numeric array, a datetime array or a duration array. For datetime input data, the interquartile range r is a duration and the quartiles q are datetime values. For duration input data, r and q are durations. NaT values are omitted like NaN values.

💡Examples
A = [2 5 6 10 11 13];
[r, q] = iqr(A)
datetime and duration input data
t = datetime(2024, 1, [1 3 5 7 30]);
[r, q] = iqr(t)
🔗See Also
quantileprctilemad
🕔Version History
Version Description
2.0.0 initial version
2.0.0 datetime and duration input data supported.
Edit this page on GitHub