normr(X) takes a single matrix or cell array of matrices and returns the matrices with rows normalized to a length of one.
Here the rows of a random matrix are normalized.
normr(X)接受单个矩阵或矩阵的单元数组,并返回行规范化为1的矩阵。
这里一个随机矩阵的行被标准化了。
x = rands(4,8)
y = normr(x)
x =
-0.1098 0.6924 0.6762 0.6636 -0.3908 -0.3945 -0.2433 -0.0069
0.8636 0.0503 -0.9607 0.0056 -0.6207 0.0833 0.7200 0.7995
-0.0680 -0.5947 0.3626 0.4189 -0.6131 -0.6983 0.7073 0.6433
-0.1627 0.3443 -0.2410 -0.1422 0.3644 0.3958 0.1871 0.2898
y =
-0.0828 0.5224 0.5102 0.5007 -0.2948 -0.2976 -0.1835 -0.0052
0.4812 0.0280 -0.5353 0.0031 -0.3458 0.0464 0.4012 0.4455
-0.0435 -0.3805 0.2320 0.2680 -0.3923 -0.4468 0.4525 0.4116
-0.2047 0.4331 -0.3032 -0.1789 0.4585 0.4979 0.2354 0.3646