MATLAB Answers

Count number of smaller than the threshold in the certain rows of cell arrays

2 views (last 30 days)
Behzad Navidi
Behzad Navidi on 17 Dec 2020
Commented: Behzad Navidi on 18 Dec 2020
Dear all,
I have a 1 x 3 cell array, each 3 array includes 360x1 double. For each 1 to 360 rows stored in every 3 arrays, I want to know how many times I have smaller than -0.5 values. For example, I want to consider all first rows in each array and count that there is any smaller than -0.5 exist in them. Then consider all second rows in each array, and so on. I don't want to look at each array individually but I need to consider every row in all arrays as integrated rows.
So input is 1 x 3 cell array. And the output is: 3 x 1 double (number of times each row has smaller than -0.5 values)
Any advice is really helpful
Thank you.

Accepted Answer

Matt J
Matt J on 17 Dec 2020
Edited: Matt J on 17 Dec 2020
sum(cell2mat(CELL)<-0.5,1).'
  3 Comments

Sign in to comment.

More Answers (0)

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!