Help with calculating median of an array without using built in function?
Mostrar comentarios más antiguos
A=[8 6 7 5 3 0 9]
b=sort(A)
b= 0 3 5 6 7 8 9
Now what are the next steps?
Respuesta aceptada
Más respuestas (2)
Azzi Abdelmalek
el 26 de Mzo. de 2016
0 votos
use n=numel(A) to get the number of element in A. If n is odd, the median will be b((n+1)/2), if n is even, try to find out.
1 comentario
Martin Kao
el 26 de Mzo. de 2016
Categorías
Más información sobre Operators and Elementary Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!