normalized this number 0.0800 in infit norm in matlab

To normalize a vector in the infinity norm, we need to divide the vector with its maximum element. For example, if we have a vector A = [2 4 1], the normalized vector in infinity norm would be A_norm_inf = A/max(A) which gives us A_norm_inf = [0.5 1 0.25]. Similarly, we can normalize a scalar in infinity norm. In this case, since the number is a scalar, we can treat it as a vector with a single element and divide it by itself. Therefore, to normalize the number 0.0800 in infinity norm in Matlab, we can do the following:

main.m
x = 0.0800; % the number to be normalized
x_norm_inf = x/max(abs(x)); % normalizing x in infinity norm
103 chars
3 lines

Here, we are using max(abs(x)) since we want to consider the absolute maximum value, as the sign does not matter in the infinity norm. The result of x_norm_inf would be a scalar value 1.0.

related categories

gistlibby LogSnag