matlab-read-write-point-cloud-file

Read and write 3-D point cloud files in PLY, PCD, LAS/LAZ, PCAP, E57, and IDC formats using MATLAB Lidar Toolbox.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-read-write-point-cloud-file
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-read-write-point-cloud-file
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/image-processing-and-computer-vision/matlab-read-write-point-cloud-file
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-read-write-point-cloud-file

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Choosing the wrong MATLAB function for a point cloud file format causes errors or silently discards lidar attributes like classification and GPS timestamps. This Skill routes each file extension to the correct reader or writer and preserves point attributes through read-write pipelines.

Core Features & Use Cases

  • Format-based routing: Maps PLY/PCD to pcread/pcwrite, LAS/LAZ to lasFileReader/lasFileWriter, PCAP to sensor-specific readers (Velodyne, Ouster, Hesai), E57 to e57FileReader, and Ibeo IDC to ibeoLidarReader.
  • Attribute preservation: Uses two-output readPointCloud and three-argument writePointCloud to keep Classification, GPSTimeStamp, and other lidar attributes intact.
  • Use Case: Convert an aerial LAS survey to a compressed PCD file while filtering by ground classification, or iterate frame-by-frame through a Velodyne PCAP recording using hasFrame/readFrame.

Quick Start

Read the point cloud from survey.laz, filter to ground points, and write the result to a compressed PCD file.

Frequently Asked Questions about matlab-read-write-point-cloud-file

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read a LAS or LAZ file in MATLAB?

Use lasFileReader to create a reader object, then call readPointCloud on it. The two-output form [ptCloud, ptAttributes] = readPointCloud(reader) also returns classification, GPS timestamps, and other lidar attributes. Calling pcread on a LAS file throws an error.

How do I read a Velodyne PCAP file in MATLAB?

Use velodyneFileReader with the file path and a mandatory device model string such as "HDL32E" or "VLP16". Then loop with hasFrame and readFrame to iterate through frames, since there is no function to load all frames at once.

Can pcwrite save point clouds to LAS format?

No, pcwrite only supports PLY and PCD formats. For LAS or LAZ output, create a lasFileWriter object and call writePointCloud. Pass the attributes object as a third argument to preserve classification and GPS timestamps.

Why does pcwrite fail with compressed encoding on PLY files?

PLY format only supports "ascii" and "binary" encoding, so Encoding="compressed" throws an error. The compressed encoding is exclusive to PCD files, where it is the default in R2026a and later.

Where are classification labels stored on a MATLAB pointCloud object?

Classification, GPSTimeStamp, LaserReturn, and ScanAngle live on the lidarPointAttributes object returned as the second output of readPointCloud, not on pointCloud. The pointCloud object holds Location, Color, Normal, and Intensity.

When should I not use file readers for lidar data?

Do not use file readers for streaming live sensor data in real time; use velodynelidar, ousterlidar, or sicklidar instead. File readers are also not for post-read processing like downsampling or denoising, which use pcdownsample and pcdenoise.