2D points to 3D Matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello, I have a set of 140 points in 2D (x,y coordinates) which when plotted form a quadrangle such as the one pictured here: http://imageshack.us/photo/my-images/43/207756bwnf8jcy.jpg/
The points are in no particular order. I'm trying to build a 3D matrix that will store these values in an order corresponding to how they are organized when plotted. For example, in that image, the points form a 10x14 grid of points. I'd like to build a 10x14x2 matrix out of those points where the (i,j,:) element of the matrix contains the x,y coordinates of the corresponding (i,j) point in the plot.
Any ideas?
0 comentarios
Respuestas (1)
Sean de Wolski
el 20 de Jun. de 2011
So put them in order! Then do the work:
idx_sorted = sortrows(xypts,[1 2]); %sort them
ij = reshape(idx_sorted,[10 14 2]); %reshape them
2 comentarios
Ver también
Categorías
Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!