matrix normalization in matlab
古いコメントを表示
hi.. i want normalize a matrix (129 x 128)..please help me with matlab codes
採用された回答
その他の回答 (3 件)
Matt J
2013 年 1 月 30 日
You need to decide how you want to define the amplitude of the matrix first. Maybe you want this
normalized = A/norm(A);
or maybe this
normalized = A/max(abs(A(:)))
Jing
2013 年 1 月 30 日
1 投票
You can use 'normc' or 'normr' for normalization. 'c' or 'r' stands for columns or rows that you want to normalize.
A = 1:6
B1 = normalize(A,'range') % default range is [0 1]
B2 = normalize(A,'range',[-1 2]) % but you can specify any range
B3 = normalize(A,'zscore','std') % zero-center and scale to have std=1
B4 = normalize(A,'norm',2) % normalize by vector p-norm (default p=2)
2 件のコメント
Sinan Islam
2024 年 8 月 3 日
The normalize function in matlab either works on columns or rows. We want a function that normalizes the matrix as a whole. We are not looking for normalizing features or observations. So the calculation must be made on global minimum and global maximum of the matrix. Thats why we flatten the matrix into one vector before doing any calculation.
DGM
2024 年 8 月 3 日
As others have mentioned, "normalize" is a terribly vague word. If the goal is to rescale the entire array with respect to global statistics, then yes, reshaping the array is one way to do so.
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!