How to make a normalized matrix ?

3 ビュー (過去 30 日間)
Caecarico Imas
Caecarico Imas 2021 年 6 月 29 日
コメント済み: Caecarico Imas 2021 年 6 月 29 日
I'm using matlab 2016. when I want to normalize the matrix, the only available syntax is normr and normc. While on the matlab website page there is a normalize syntax. why is there no normalize syntax in my matlab? Then how to normalize matlab manually?
  2 件のコメント
Bhaskar R
Bhaskar R 2021 年 6 月 29 日
The command normalize introduced in MATLAB 2018a version, as per your statment you are using MATLAB2016 version. Upgrade your MATLAB version or you could write your own normalize function as per your requirements
Caecarico Imas
Caecarico Imas 2021 年 6 月 29 日
Thankyou so much.

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

回答 (1 件)

DGM
DGM 2021 年 6 月 29 日
編集済み: DGM 2021 年 6 月 29 日
If you just want to normalize the array such that its extrema correspond to [0 1], then for a given array A:
mn = min(A(:));
mx = max(A(:));
B = (A-mn) ./ (mx-mn);
If you have IPT, you can also use the short syntax of the mat2gray() function:
B = mat2gray(A);
  1 件のコメント
Caecarico Imas
Caecarico Imas 2021 年 6 月 29 日
Thankyou so much.

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

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by