Normalize a diagonal matrix such that each element belongs to $[0,1]$.

2k Views Asked by At

Let $\mathbf{x}\in\Bbb{R}^n$ be an $n$-dimensional real vector and $C\in\Bbb{R}^{n\times n}$ be a diagonal real matrix. Suppose that two vectors $\mathbf{r}_\min,\mathbf{r}_\max\in\Bbb{R}^n$ consisting of minimum and maximum values for the various dimensions of $\mathbf{x}$ are given, that is $$ \mathbf{r}_\min = (r_\min^1,\ldots,r_\min^j,\ldots,r_\min^n)^\top, $$ and $$ \mathbf{r}_\max = (r_\max^1,\ldots,r_\max^j,\ldots,r_\max^n)^\top. $$

We normalize $\mathbf{x}=(x_1,\ldots,x_j\ldots,x_n)^\top$ in $[0,1]$ by applying to each dimension the following rule: $$ \hat{x}_j = \frac{x_j-r_\min^j}{r_\max^j-r_\min^j}. $$

I would like to further normalize $C=\operatorname{diag}(c_1,\ldots,c_j,\ldots,c_n)$ given that there are also minimum and maximum values for each dimension, let's call them again $\mathbf{r}_\min,\mathbf{r}_\max\in\Bbb{R}^n$.

How could I do that? Keep in mind that trying to use the same rule did not work.

Additionally, how could I do that in case of a full matrix $C$? What would be necessary then besides the vectors $\mathbf{r}_\min,\mathbf{r}_\max$?

Thank you very much in advance.