use rescale with matrix
조회 수: 2 (최근 30일)
이전 댓글 표시
hi,i want to normalize matrix using interval -1 and 1
load('matlab_E');
B=rescale(E,1,-1);
댓글 수: 0
채택된 답변
Steven Lord
2025년 5월 9일
댓글 수: 8
Voss
2025년 5월 10일
@Luca Re: Given:
have = [0 0.2 0.4 0.6 0.8 1];
min_to_get = 10;
max_to_get = 15;
Here's the math that does what you want:
min_have = min(have);
max_have = max(have);
to_get = (have-min_have)./(max_have-min_have).*(max_to_get-min_to_get)+min_to_get
Or, here's the MATLAB function call to do it:
to_get = rescale(have,min_to_get,max_to_get)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Time Series에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!