Assume that you having two vectors $x \in \Re^n$ and $y \in \Re^n$ and you want to create matrix $X \in \Re^{n x n}$.
The element of the matrix can be accessed from $X(i, j) = x_{x,j}$ coordinates, so that means $i$ and $j$ are non-negative integers only $i, j >= 0$
The matrix is going to be a scatter matrix, that means if I plot $x$ and $y$ it might looks like this
Problems:
The problems are that $x$ and $y$ contains decimal numbers of arbitary types e.g -0.35 or 5.15. It's difficult to turn them into real integers without change the precision.
So, how can that be done? Turning $x$ and $y$ into a scatter matrix $X$ that every coordinate $x_{i,j}$ has the 8-bit value 255 and the rest of the matrix is only 0?
Data:
Assume that you have this Matlab code
x = [linspace(0, 5, 10) linspace(-5, -2, 16)];
y = [5*x(1:13), -7*x(14:26)];
And from that you want to create a matrix, as it was plotted with
plot(x, y, '.')
Notice that this is not a programming question, it's a real math question how to turn $x$ and $y$ inte coordinates where the coordinates cannot be negative.
My suggestion:
Firstly. What I think that need to be done is to shift the data so there are only positive values in $x$ and $y$
$$x^* = x - min(x)$$ $$y^* = y - min(y)$$
Then plot it
Now, the next problem that I need help with, scale $x$ and $y$ so they can be intepreted as integers. How can I achieve that?

