How to normalize the values of matrix to make it greater than zero and less than one?

5 次查看(过去 30 天)
hello,
ho to normalize the values of a matrix to make it greater than zero and less than one?
regards,

采纳的回答

Matt J
Matt J 2018-10-23
编辑:Matt J 2018-10-23
B=(A-min(A(:)))/(max(A(:))-min(A(:))) ;
  4 个评论

请先登录,再进行评论。

更多回答(3 个)

madhan ravi
madhan ravi 2018-10-23
编辑:madhan ravi 2018-10-23
Try :
Np = normalize(A,'norm',1) % A your matrix
  1 个评论
Sarah A
Sarah A 2018-10-23
编辑:Sarah A 2018-10-23
This error occur:
Undefined function 'normalize' for input arguments of type 'double'.
when I searched about "normalized" function I got this:
function ydata = normalize(this,ydata,Xlims,varargin)
%NORMALIZE Scales Y data to normalized time data range.
%
% Input arguments:
% * YDATA is the Y data to be normalized
% * XLIMS are the X limits for the axes of interest
% * The last argument(s) is either an absolute index or a pair
% of row/column indices specifying the axes location in the
% axes grid.
% Author(s): P. Gahinet
[ns,ny,nu] = size(this.Amplitude);
if ny>0
[ymin,ymax,FlatY] = ydataspan(this.Time,this.Amplitude(:,varargin{:}),Xlims);
ydata = (ydata - (ymin+ymax)/2)/((ymax-ymin)/2+FlatY);
end
Copyright 1986-2004 The MathWorks, Inc.

请先登录,再进行评论。


Matt J
Matt J 2018-10-23
编辑:Matt J 2018-10-23
delta=0.01;
B = rescale(A,delta,1-delta);

Matt J
Matt J 2018-10-23
  4 个评论
Sarah A
Sarah A 2018-10-23
no I want to normalize here where the output of normalization is greater than zero and less than one.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by