You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
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 (2026). Count elements/rows (https://www.mathworks.com/matlabcentral/fileexchange/12283-count-elements-rows), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0.0 (2.3 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
