Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Find Average of elements having less difference among each other

3 vues (au cours des 30 derniers jours)
Tahir Mahmood
Tahir Mahmood le 5 Avr 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
Hi, Lets say, A=[20,10,22,10,12]. I want to calculate the difference among each element in the A. If the difference is less than 5 or 0, then average all that elements. So for this case, the result will be.
(20+22)/2 and (10+10+12)/3
Result=[21,10]. How to do it?

Réponses (0)

Cette question est clôturée.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by