how to normalize a matrix?????

2 ビュー (過去 30 日間)
abdulkader helwan
abdulkader helwan 2014 年 10 月 22 日
回答済み: Steven Lord 2021 年 2 月 22 日
hello everyone... i need a code to normalize( between 0 and 1) a matrix 7*50. the normalization process should be for each column not row**. in other words, the program should seek for the largest value in each column and divide all the elements in that column by it. can anybody help plzz

回答 (3 件)

James Tursa
James Tursa 2014 年 10 月 22 日
編集済み: James Tursa 2014 年 10 月 22 日
Assuming values are positive, e.g.,
M = your matrix
N = bsxfun(@rdivide,M,max(M)); % Normalized (scaled) matrix by column
  1 件のコメント
MANNY LEN VILLA SUAREZ
MANNY LEN VILLA SUAREZ 2021 年 2 月 22 日
excelent,thank you

サインインしてコメントする。


Greg Heath
Greg Heath 2014 年 10 月 23 日
rng('default')
A = 100*randn(3)
Amin = repmat(min(A),3,1)
Amax = repmat(max(A),3,1)
a = (A-Amin)./(Amax-Amin)
Hope this helps.
Thank you for formally accepting my answer
Greg
  1 件のコメント
Image Analyst
Image Analyst 2014 年 10 月 25 日
abdulkader's "Answer" moved here:
thnaks bro.. that was helpful

サインインしてコメントする。


Steven Lord
Steven Lord 2021 年 2 月 22 日
Use the normalize function with a dim input and the 'range' normalization method.

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by