Hi! I have a vector that I want to group into intervals so that the values are greater than 50 but less than 500 apart in each interval and omit numbers that do not fall in this range. For example if I had vector [5 50 400 1000 1200] I would want to separate this into [50 400] and [1000 1200]. How can I do this? Thank you!

 Respuesta aceptada

Star Strider
Star Strider el 12 de Mayo de 2018
I would do this:
D = randi(1300, 1, 250); % Create Data
hc = histcounts(D, [50 400 1000 1200]); % Ask ‘histcounts’
Result = hc([1 3]); % Return Requested Intervals

2 comentarios

Natalie St. John
Natalie St. John el 13 de Mayo de 2018
thank you!
Star Strider
Star Strider el 13 de Mayo de 2018
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Distribution Plots en Centro de ayuda y File Exchange.

Preguntada:

el 12 de Mayo de 2018

Comentada:

el 13 de Mayo de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by