How map values of array to 0 and 1
조회 수: 35 (최근 30일)
이전 댓글 표시
How can i write a function such that it takes an array, and outputs an array of same size with values lying in [0,1] but also that the largest value is mapped to 1, and smallest to 0?
댓글 수: 0
답변 (2개)
Guillaume
2019년 12월 6일
It's trivial normalisation. Subtract the minimum of your array so the new minimum is 0, then divide by the max of that new array so the max becomes 1.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!