Clear Filters
Clear Filters

Counting the maximum occurrence of an element in 3d matrix ?

3 views (last 30 days)
I have a matrix of dimensions (61x61x122) or (lat,lon,days), which has 0 and 1 values for random days.
I want to calculate the value of maximum occurrence of 1 for each grid (lat,lon).

Accepted Answer

madhan ravi
madhan ravi on 30 Aug 2019
sum(3dmatrix==1,[1,2])
% for older versions
sum(sum(3dmatrix==1,2),1)
  4 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!