How to delete a column of an array?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
lucca k
am 2 Nov. 2015
Kommentiert: lucca k
am 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
0 Kommentare
Akzeptierte Antwort
Dima Lisin
am 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);
Weitere Antworten (1)
Adam
am 2 Nov. 2015
array = array(:,1:2);
or
array(:,3) = [];
3 Kommentare
Adam
am 2 Nov. 2015
Bearbeitet: Adam
am 2 Nov. 2015
I am not familiar with 'PointCloud', but I assume it is a class that is used for 3d point representations so just throwing away the 3rd column would not work in that case.
You need to give more information about what pointCloud is and the structure of your array for that case.
Siehe auch
Kategorien
Mehr zu Point Cloud Processing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!