gen_scale.m
来自「clustering_code ,Clustering Through Rank」· M 代码 · 共 46 行
M
46 行
function [X_out, A, B] = Gen_Scale(X,lb,ub)%% Clustering Through Ranking On Manifolds% Version 0.2%% Copyright by Markus Breitenbach and Gregory Z. Grudic% This code is for your personal and research use only.%% http://www.cs.colorado.edu/~grudic/% http://ucsu.colorado.edu/~breitenm/%% This software is provided "as is," without warranty of any kind, express% or implied. In no event shall the authors be held liable% for any direct, indirect, incidental, special or consequential damages% arising out of the use of or inability to use this software.%%lb = 0;, ub = 1;X_out = zeros(size(X));n = size(X,2); % input dimension sca = zeros(n,1);mina = zeros(n,1);maxa = zeros(n,1);A = zeros(n,1);B = zeros(n,1);for i=1:n mina(i) = min(X(:,i)); maxa(i) = max(X(:,i)); sca(i) = maxa(i) - mina(i);endfor i=1:n if abs(sca(i)) > eps A(i) = (ub - lb)/sca(i); B(i) = lb - A(i)*mina(i); X_out(:,i) = A(i)*X(:,i) + B(i); else A(i) = 1.0; B(i) = -mean(X(:,i)); X_out(:,i) = A(i)*X(:,i) + B(i); endend
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?