Calculation of conditional expectations
2 views (last 30 days)
Show older comments
Suppose I have a vector A and I would like to calculate the sum of the elements in A divided by the number of positive elements of A. Please advise.
6 Comments
Walter Roberson
on 3 Jun 2018
That code assumes you have a row vector.
That code counts the number of non-zeros in the vector, instead of counting the number of positive values.
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!