Code covered by the BSD License  

Highlights from
Count elements/rows

Be the first to rate this file! 5 Downloads (last 30 days) File Size: 2.3 KB File ID: #12283

Count elements/rows

by Elleke Janssen

 

15 Sep 2006 (Updated 15 Sep 2006)

Counts elements in N-DIM matrices & rows in max 2-DIM matrices

| Watch this File

File Information
Description

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

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
matrices Elleke Janssen 22 Oct 2008 08:39:34
count Elleke Janssen 22 Oct 2008 08:39:34
elements Elleke Janssen 22 Oct 2008 08:39:34
rows Elleke Janssen 22 Oct 2008 08:39:34
ndim Elleke Janssen 22 Oct 2008 08:39:34
matrices Elleke Janssen 22 Oct 2008 08:39:34
matrix manipulation Elleke Janssen 22 Oct 2008 08:39:34

Contact us at files@mathworks.com