File Exchange

image thumbnail

Count elements/rows

version 1.0.0.0 (2.3 KB) by Elleke Janssen
Counts elements in N-DIM matrices & rows in max 2-DIM matrices

0 Downloads

Updated 15 Sep 2006

View License

This functions results in absolute and relative frequencies of elements in N-dimensional matrices or rows 2-dimensional matrices.

Example:

Example:
x = [Inf NaN NaN
1 2 3
1 2 -Inf
1 2 -Inf
1 2 3
1 2 5
Inf NaN NaN];

yr = count(x, 'rows')
yr =
1 2 -Inf 2 0.2857
1 2 3 2 0.2857
1 2 5 1 0.1429
Inf NaN NaN 2 0.2857

yr = count(x)
yr =
-Inf 2.0000 0.0952
1.0000 5.0000 0.2381
2.0000 5.0000 0.2381
3.0000 2.0000 0.0952
5.0000 1.0000 0.0476
Inf 2.0000 0.0952
NaN 4.0000 0.1905

Cite As

Elleke Janssen (2020). Count elements/rows (https://www.mathworks.com/matlabcentral/fileexchange/12283-count-elements-rows), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux