https://ch.mathworks.com/help/lidar/ref/pcorganize.html
pcorganize - Convert 3-D point cloud into organized point cloud - MATLAB
This MATLAB function converts a 3-D point cloud, ptCloudIn, into an organized point cloud, ptCloutOut, using the sensor parameters, params.
point cloudconvertorganizedmatlab