How to delete a column of an array?

3 views (last 30 days)
lucca k
lucca k on 2 Nov 2015
Commented: lucca k on 2 Nov 2015
Hello,
I have a n by 3 single array. As I want to plot just the x and y data, I need to delete the z column in that array. Could you please tell me how that is done?
Thanks in advance!
Lucca

Accepted Answer

Dima Lisin
Dima Lisin on 2 Nov 2015
You do not have just an array of points. You have one pointCloud object, which contains an array of x,y,z coordinates in the Location property. So you can do this:
array = ptCloud.Location(:, 1:2);
  1 Comment
lucca k
lucca k on 2 Nov 2015
Thank you this works, but in the array there are 480 x and y values now. Before there have been 80 000. Do you know why?

Sign in to comment.

More Answers (1)

Adam
Adam on 2 Nov 2015
array = array(:,1:2);
or
array(:,3) = [];
  3 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by