use rescale with matrix
    6 次查看(过去 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!