Squeeze array elements with almost (but not exactly) equal value into one element.
Show older comments
I have the array
A=[1.74500 1.74567 1.73985 1.74271 6.67891 6.662314 6.61031 10.78678 10.76789 ...]
I want to squeeze all the elements 1.7xxxx into one element that is the average of all these elements, then go to the next series 6.6xxxx and reduce them to only one element and so on so that A at the end will look like:
A=[1.7xxxxx 6.6xxxxx 10.7xxxxx ...]
Accepted Answer
More Answers (1)
Saeid
on 19 Jun 2018
0 votes
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!