Suppose I had 51,42,43,56,76,54,34,56,78,80 in a column how would I use discretize function to put the numbers between 50-59 into 50, and those between 60-69 into 60 and so on?

 채택된 답변

Sean de Wolski
Sean de Wolski 2016년 9월 19일

0 개 추천

bins = 0:10:100;
x = [51,42,43,56,76,54,34,56,78,80]
newx = bins(discretize(x,bins))

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

질문:

2016년 9월 19일

답변:

2016년 9월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by