📄 rescale.m
字号:
function theResult = rescale(x, xmin, xmax)% rescale -- Scale data to a range.% rescale(x, xmin, xmax) rescales the values of x% to the range [xmin:xmax] (default = [0:1]).% (Needs upgrade to handle constant data.) % Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.% All Rights Reserved.% Disclosure without explicit written consent from the% copyright owner does not constitute publication. % Version of 23-Apr-1999 13:19:07.if nargin < 1, help(mfilename), return, endif nargin < 2, xmin = 0; endif nargin < 3, xmax = 1; endx(:) = x - min(x(:));x(:) = x ./ max(x(:));x = x .* (xmax - xmin) + xmin;if nargout > 0 theResult = x;else disp(x)end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -