How to format surface data into XYZ point cloud?

F
flemingtb · Feb 19, 2022 · 1.9K views
Question
I have a .csv data set that is 10x22 surface data and i'd like to convert it to XYZ point cloud. What is the best way to do this in Matlab?  
Expert Answer
Profile picture of John Michell
John Michell PhD Expert
Answered Nov 20, 2025
vector_of_x = as appropriate
vector_of_y = as appropriate
[X, Y] = meshgrid(vector_of_x, vector_of_y);
points = [X(:), Y(:), z(:)];
ptCloud = pointcloud(points);
pointCloud is part of the Computer Vision Toolbox
pointCloud() is a particular data type in MATLAB. If you do not have Computer Vision, then you cannot create the datatype, so it is not clear what you want to do? If you just want an array of three columns, X, Y, Z, and you are starting from a 2D array, then use the code I posted but stop after the assignment to points
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!