MATLAB: How to count the total number of objects detected

counterMATLABsolidity

I'm trying to make a counter to count the number of objects detected. I have followed the relevant webinars and used the Image Processing Toolbox to identify 4 objects with these solidity:
COMMAND WINDOWS
[imageStats(:).Solidity]
ans =
0.8787 0.9547 0.7749 0.9721
I need a counter to count the number of object with solidity above 0.7, and display "Total number of objects detected: 4" Can anyone help me with this?

Best Answer

sum([imageStats(:).Solidity]>0.7)