I am trying to print the xyz coordinate value of the pointcloud data to a file. I need 3 columns in the file as indicate the x, y, and z value for each column.
This is the code that I import the pointcloud.
ptCloud = pcread ('pointcloud.ply');
After that I retrieve the xyz coordinate of the pointcloud and display it.
xyz = ptCloud.Location;display (xyz);
The result is as follow:
So, I print it out to a text file.
file = fopen ('xyzCoordinate.txt', 'wt');fprintf (file, '%f\n', xyz);fclose (file);
However, there is only one column in the text file that not what I want.
What is the problem? I have no idea what mistake I have made, please help!
Best Answer