MATLAB: Regular points deployment on a cartesian system

cartesian systemcoordinatespoint deployment

Hi everyone, i would create a points deployment as the following figure:
The distance along the x-axis (the short edge of the rectangular) are 10m then two segments of 15 m each one and then a last 10 m segment for a total length of 50 m. The distances along the y-axis are shown in the figure. I would use a cartesian system starting from the fifth row of points that will have as coordinates x=0, y=0 and z a constant. Starting from the 5th raw toward the top of the figure I will have points with y coordinate positive, on the other hand from the 5th raw to the bottom I will have points with y coordinate negative. Is it possible do it with matrix? Thank you!

Best Answer

This puts the points in the appropriate places:
x = [10 15 15];
x = cumsum(x);
y = linspace(5,95,9);
[X Y] = meshgrid(x,y);
figure(1)
plot(X, Y, '*b')
axis([0 50 0 100])
axis square
grid
EDIT: Added figure