Hi everyone. I'm using R2017b to work with a large matrix. The matrix is the result of calculating the value of an equation while looping through coefficients (and interpolating between coefficients) representing the 95% CI.
What I would like to do is:
1. Count the number of elements that fall under certain range on a per column basis (say, elements between 0 and 0.5)
2. Assign that count to an element of a different matrix
3. Repeat steps 1 and 2 using a new range (say, elements between 0.5 and 1.0)
4. Repeat steps 1 through 3 for all columns
Example:
Count values between 0 and 0.5, and 0.5 and 1.0 in matrix A and assign the results to matrix B
A= [0.83 0.02NaN 0.690.7 0.720.3 0.32NaN 0.80.02 0.040.56 NaN0.78 NaN0.01 0.030.67 NaN];
B =
3 4 %% Number of elements that satisfy the first condition
5 3 %% Number of elements that satisfy the second condition
I think my question is related to this one: https://uk.mathworks.com/matlabcentral/answers/37196-count-number-of-specific-values-in-matrix.
Hope you can help. Cheers!
Best Answer