MATLAB: How to give number to the node randomly

numbering the node randomly

I placed 50 random node in the area of 180*40.
Now how to give number to that random node from 1-50 and also how to calculate the coordinates of each random node.

Best Answer

Since each point is a random number, there is no need to shuffle/randomize their indexes in the x and y array afterwards. If you think there is for some reason, then tell us the reason why x and y will need to be randomly shuffled with randperm:
x = x(randperm(length(x)));
y = y(randperm(length(y)));
It's not clear why you need to do this.