Regular points deployment on a cartesian system

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!

 Akzeptierte Antwort

Star Strider
Star Strider am 1 Apr. 2014
Bearbeitet: Star Strider am 1 Apr. 2014

0 Stimmen

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

5 Kommentare

Francesco
Francesco am 1 Apr. 2014
thank you, in the meanwhile I created this deployment and I obtained a 27x3 matrix of coordinates, first column is the x, the 2nd the y and the third the z. From this matrix can I plot the points? Both in 2d and 3d?
What is z? You didn’t mention it previously.
The X and Y in my code are both (correctly) (9x3) matrices. It works — I tested it before I posted it.
I need to see your code and how you created your (27x3) matrix in order to understand what you did.
Francesco
Francesco am 1 Apr. 2014
Bearbeitet: Francesco am 1 Apr. 2014
z is the elevation of each point but it's a constant my matrix is this:
i would plot each of these points where the first column is the x, the 2nd y and the third z
Francesco
Francesco am 1 Apr. 2014
Bearbeitet: Francesco am 1 Apr. 2014
solved with plot3 command!Thank you for your help anyway!
Star Strider
Star Strider am 1 Apr. 2014
Bearbeitet: Star Strider am 1 Apr. 2014
I used scatter3.
With Z included, my code becomes:
x = [10 15 15];
x = cumsum(x);
y = linspace(5,95,9);
z = 33;
[X Y Z] = meshgrid(x,y,33);
xv = X(:);
yv = Y(:);
zv = Z(:);
figure(1)
scatter3(xv, yv, zv)
xlabel('X (m)')
ylabel('Y (m)')
grid on
You would plot your points with these statements:
figure(2)
scatter3(mBSCoordinates(:,1), mBSCoordinates(:,2), mBSCoordinates(:,3))
grid on

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Geographic Plots finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by