-1

可能重复:
MATLAB:如何将向量归一化/反归一化以范围 [-1;1]
matlab 将矩阵数据重新缩放为 -1 到 1

考虑一个 100x200 矩阵A,是否有一个builtin函数(或一组builtin函数)可以将范围设置A为任意比例?

4

1 回答 1

3

这符合条件吗?

R = [.5 .9];
dR = diff( R );

A =  A - min( A(:)); % set range of A between [0, inf)
A =  A ./ max( A(:)) ; % set range of A between [0, 1]
A =  A .* dR ; % set range of A between [0, dRange]
A =  A + R(1); % shift range of A to R
于 2013-01-16T17:16:14.137 回答