Matlab Read Write Point Cloud File logo

Matlab Read Write Point Cloud File

OrganizationPopular
matlab
matlab-read-write-point-cloud-file

Read and write 3-D point cloud data using Lidar Toolbox file I/O. Covers PLY, PCD, LAS/LAZ, PCAP (Velodyne/Ouster/Hesai), E57, and IDC (Ibeo) formats. Use when loading point clouds from disk, saving to disk, choosing the correct reader or writer for a file format, extracting or preserving lidar point attributes, reading Ibeo IDC sensor recordings, or converting between formats.

Overview

Publishermatlab
Repositorymatlab-agentic-toolkit
Skill namematlab-read-write-point-cloud-file
Stars
1.2K
Forks
138
Bundled files
4
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by matlab on GitHub. Read the source before you install it.

Installation

Install the Matlab Read Write Point Cloud File AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/image-processing-and-computer-vision/matlab-read-write-point-cloud-file
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit.git /tmp/matlab-agentic-toolkit
mkdir -p .claude/skills
cp -r /tmp/matlab-agentic-toolkit/skills-catalog/image-processing-and-computer-vision/matlab-read-write-point-cloud-file .claude/skills/matlab-read-write-point-cloud-file
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Matlab Read Write Point Cloud File in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Matlab Read Write Point Cloud File on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Matlab Read Write Point Cloud File is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Point Cloud File I/O

Read and write 3-D point cloud data in MATLAB using Lidar Toolbox file I/O functions, covering PLY, PCD, LAS/LAZ, sensor PCAP, E57, and IDC (Ibeo) formats.

When to Use

  • Loading a point cloud file from disk into a pointCloud object
  • Saving a pointCloud object to disk in any supported format
  • Deciding which reader or writer function to use for a given file format
  • Reading LAS/LAZ files with selective filtering (ROI, classification, GPS time)
  • Extracting or preserving lidar point attributes (classification, GPS timestamps, scan angle)
  • Reading Velodyne, Ouster, or Hesai PCAP sensor recordings frame-by-frame
  • Reading multi-scan E57 files with indexed access
  • Reading Ibeo IDC sensor recordings with message-based access
  • Converting between point cloud formats (e.g., LAS to PLY, PCD to LAZ)

When NOT to Use

  • Streaming live sensor data in real time (use velodynelidar, ousterlidar, sicklidar)
  • Processing or filtering point clouds after reading (use pcdownsample, pcdenoise)
  • Reading or writing surface meshes (use readSurfaceMesh, writeSurfaceMesh)
  • Saving point cloud variables to MAT-files (use save)
  • Visualizing point clouds (use pcshow, pcplayer, pcviewer)

Must-Follow Rules

  1. Route by file extension, not by habit — pcread ONLY supports .ply and .pcd files. For .las/.laz use lasFileReader + readPointCloud. For .pcap use the sensor-specific file reader (velodyneFileReader, ousterFileReader, or hesaiFileReader). For .e57 use e57FileReader. Calling pcread on a LAS or PCAP file produces an error, not a warning. Similarly, pcwrite ONLY writes PLY and PCD — for LAS/LAZ output use lasFileWriter + writePointCloud.

  2. PCAP file readers require a mandatory device identifier — never guess it — velodyneFileReader requires a DeviceModel string (e.g., "HDL32E"). hesaiFileReader requires a DeviceModel string (e.g., "PandarXT32"). ousterFileReader requires a CalibrationFile path (JSON). If the user has not specified the device model or calibration file, ASK — do not assume a default. There is no default value; omitting it causes an error.

  3. Use two-output syntax to get point attributes from LAS/LAZ — [ptCloud, ptAttributes] = readPointCloud(reader) returns a lidarPointAttributes object containing Classification, GPSTimeStamp, LaserReturn, NumReturns, ScanAngle, and more. The single-output form discards these attributes permanently. Intensity is on the pointCloud object (.Intensity property), NOT on lidarPointAttributes.

  4. Preserve attributes with three-argument writePointCloud — writePointCloud(writer, ptCloud, ptAttributes) preserves Classification, GPSTimeStamp, and other lidar attributes in LAS/LAZ output. The two-argument form writePointCloud(writer, ptCloud) discards all attributes. If the user has attributes from lasFileReader/readPointCloud, always pass them through.

  5. PLY only supports ascii and binary encoding — Calling pcwrite(ptCloud, "file.ply", Encoding="compressed") throws an error. Only "ascii" and "binary" are valid for PLY. The "compressed" encoding is exclusive to PCD format. Defaults (R2026a+): PLY="binary", PCD="compressed".

  6. Always use string syntax — Use double-quoted strings ("text") for all literal text arguments (filenames, device models, encoding values, Name=Value values). Use Name=Value syntax for all name-value pairs. Never use character vectors ('text') or legacy 'Name','Value' pair syntax.

Preflight Procedure

  1. List MATLAB functions to call
  2. Check references/INDEX.md for each (function-level + task-level tables)
  3. Read required quick-ref files
  4. State at response top: Preflight: quick-ref/xxx.md, quick-ref/yyy.md (or Preflight: none required)

Key Functions

FunctionPurposeFormatKey Constraint
pcreadRead point cloud from filePLY, PCDSingle call, returns pointCloud
pcwriteWrite point cloud to filePLY, PCDEncoding varies by format
lasFileReaderCreate LAS/LAZ reader objectLAS, LAZTwo-step: create reader, then readPointCloud
lasFileWriterCreate LAS/LAZ writer objectLAS, LAZTwo-step: create writer, then writePointCloud
velodyneFileReaderCreate Velodyne PCAP readerPCAPMandatory DeviceModel (2nd arg)
ousterFileReaderCreate Ouster PCAP readerPCAPMandatory CalibrationFile (2nd arg)
hesaiFileReaderCreate Hesai PCAP readerPCAPMandatory DeviceModel (2nd arg)
e57FileReaderCreate E57 reader objectE57Use readPointCloud(reader, idx) for multi-scan
ibeoLidarReaderCreate Ibeo IDC reader objectIDCUse readMessages to read scan data

Decision Framework

READING — What is the file extension?
├── .ply / .pcd → pcread(filename)
├── .las / .laz → lasFileReader(filename) + readPointCloud(reader)
├── .pcap (Velodyne) → velodyneFileReader(filename, deviceModel)
├── .pcap (Ouster)  → ousterFileReader(filename, calibrationFile)
├── .pcap (Hesai)   → hesaiFileReader(filename, deviceModel)
├── .e57           → e57FileReader(filename) + readPointCloud(reader, idx)
└── .idc (Ibeo)    → ibeoLidarReader(filename) + readMessages(reader)

WRITING — What output format does the user need?
├── .ply → pcwrite(ptCloud, "file.ply")
│         Encoding: "ascii" or "binary" (default: binary)
├── .pcd → pcwrite(ptCloud, "file.pcd")
│         Encoding: "ascii", "binary", or "compressed" (default: compressed)
├── .las → lasFileWriter("file.las") + writePointCloud(writer, ptCloud)
└── .laz → lasFileWriter("file.laz") + writePointCloud(writer, ptCloud)
           Optional: pass ptAttributes as 3rd arg to preserve attributes

PCAP sensor identification: If the user says "Velodyne", "Ouster", or "Hesai" — use the matching reader. If they just say "PCAP file" without specifying the sensor, ASK which sensor produced it.

Ibeo IDC files: If the user has an .idc file, use ibeoLidarReader. Unlike other readers, it uses readMessages (not readPointCloud or readFrame) and returns message-based scan data.

Velodyne device models: VLP16, PuckLITE, PuckHiRes, VLP32C, HDL32E, HDL64E, VLS128, VelarrayH800

Hesai device models: Pandar128E3X, Pandar64, PandarQT, PandarXT32

Gotchas

pcread called on LAS/LAZ file

pcread only supports PLY and PCD formats. Attempting to use it on LAS, LAZ, PCAP, or E57 files throws an error.

matlab
% WRONG: pcread does not support LAS
ptCloud = pcread("survey.las");

% CORRECT: Use lasFileReader for LAS/LAZ
reader = lasFileReader("survey.las");
ptCloud = readPointCloud(reader);

Compressed encoding on PLY file

The "compressed" encoding is only valid for PCD format. PLY supports only "ascii" and "binary".

matlab
% WRONG: compressed not supported for PLY
pcwrite(ptCloud, "output.ply", Encoding="compressed");

% CORRECT: use binary for compact PLY
pcwrite(ptCloud, "output.ply", Encoding="binary");

% CORRECT: compressed is valid for PCD
pcwrite(ptCloud, "output.pcd", Encoding="compressed");

Using pcwrite for LAS/LAZ output

pcwrite does not support LAS or LAZ format. It only handles PLY and PCD.

matlab
% WRONG: pcwrite cannot write LAS
pcwrite(ptCloud, "output.las");

% CORRECT: use lasFileWriter for LAS/LAZ
writer = lasFileWriter("output.las");
writePointCloud(writer, ptCloud);

Losing attributes with two-argument writePointCloud

When writing LAS/LAZ, the two-argument form discards lidar point attributes. Always pass the attributes object if available.

matlab
% WRONG: attributes are discarded
reader = lasFileReader("input.laz");
[ptCloud, ptAttr] = readPointCloud(reader);
writer = lasFileWriter("output.laz");
writePointCloud(writer, ptCloud);  % ptAttr lost!

% CORRECT: preserve attributes with 3-argument form
reader = lasFileReader("input.laz");
[ptCloud, ptAttr] = readPointCloud(reader);
writer = lasFileWriter("output.laz");
writePointCloud(writer, ptCloud, ptAttr);

Accessing classification from the wrong object

Classification, GPSTimeStamp, LaserReturn, and other lidar-specific attributes are on lidarPointAttributes, not on pointCloud. The pointCloud object holds Intensity (and Location, Color, Normal).

matlab
% WRONG: pointCloud does not have Classification
reader = lasFileReader("data.laz");
ptCloud = readPointCloud(reader);
labels = ptCloud.Classification;  % Error

% CORRECT: Use two-output syntax
reader = lasFileReader("data.laz");
[ptCloud, ptAttributes] = readPointCloud(reader);
labels = ptAttributes.Classification;
intensity = ptCloud.Intensity;  % Intensity is on pointCloud

Reading all PCAP frames without a loop

PCAP readers are frame-based iterators. There is no single function to load all frames at once.

matlab
% WRONG: No readAll or similar function
reader = velodyneFileReader("lidarData_ConstructionRoad.pcap", "HDL32E");
allPoints = readPointCloud(reader);  % readPointCloud is not a method

% CORRECT: Loop with hasFrame/readFrame
reader = velodyneFileReader("lidarData_ConstructionRoad.pcap", "HDL32E");
while hasFrame(reader)
    ptCloud = readFrame(reader);
end

Patterns

Read a PLY or PCD file

matlab
ptCloud = pcread("scene.ply");
fprintf("Points: %d\n", ptCloud.Count);
fprintf("X range: [%.2f, %.2f]\n", ptCloud.XLimits);

Read LAS file with classification filtering

matlab
reader = lasFileReader("aerial.laz");
[ptCloud, ptAttributes] = readPointCloud(reader, Classification=[2 6]);
labels = ptAttributes.Classification;
fprintf("Ground + building points: %d\n", ptCloud.Count);

Read Velodyne PCAP frames

matlab
reader = velodyneFileReader("lidarData_ConstructionRoad.pcap", "HDL32E");
fprintf("Total frames: %d\n", reader.NumberOfFrames);
while hasFrame(reader)
    ptCloud = readFrame(reader);
end

Read E57 file with multiple scans

matlab
reader = e57FileReader("building.e57");
fprintf("Scans in file: %d\n", reader.NumPointClouds);
for idx = 1:reader.NumPointClouds
    ptCloud = readPointCloud(reader, idx);
    fprintf("Scan %d: %d points\n", idx, ptCloud.Count);
end

Write point cloud to PLY (binary)

matlab
ptCloud = pointCloud(rand(1000,3), Color=uint8(rand(1000,3)*255));
pcwrite(ptCloud, fullfile(tempdir, "output.ply"), Encoding="binary");

Write point cloud to PCD (compressed)

matlab
ptCloud = pcread(fullfile(toolboxdir("lidar"), "lidardata", "highwayScene.pcd"));
pcwrite(ptCloud, fullfile(tempdir, "scene_compressed.pcd"), Encoding="compressed");

Read LAS and write to LAZ preserving attributes

matlab
reader = lasFileReader("input.las");
[ptCloud, ptAttr] = readPointCloud(reader);
writer = lasFileWriter(fullfile(tempdir, "output.laz"));
writePointCloud(writer, ptCloud, ptAttr);

Convert PCD to PLY

matlab
ptCloud = pcread("scene.pcd");
pcwrite(ptCloud, fullfile(tempdir, "scene.ply"), Encoding="binary");

Convert LAS to PCD

matlab
reader = lasFileReader("survey.las");
ptCloud = readPointCloud(reader);
pcwrite(ptCloud, fullfile(tempdir, "survey.pcd"), Encoding="compressed");

Read Ibeo IDC file

matlab
reader = ibeoLidarReader("sensor_data.idc");
fprintf("Message types: %s\n", strjoin(reader.MessageTypes, ", "));
fprintf("Total messages: %d\n", reader.NumMessages);

% Read all messages — returns array of pointCloud objects
ptClouds = readMessages(reader);

% Two-output form: get message metadata (timestamps, labels, plane info)
[ptClouds, messageData] = readMessages(reader);

% Filter by message type: "Scan" or "PointCloudPlane"
ptClouds = readMessages(reader, Messages="Scan");

% Filter by time range
tStart = reader.FileInfo.TimeStamps{1}(1);
tEnd = tStart + seconds(10);
ptClouds = readMessages(reader, Time=[tStart tEnd]);

ibeoLidarReader key details:

  • Supports IDC files from Ibeo FUSION SYSTEM/ECU sensors
  • Two message types: "Scan" (data type 0x2205) and "PointCloudPlane" (data type 0x7510)
  • readMessages returns an array of pointCloud objects (one per message)
  • Second output messageData is a cell array of structs with MessageType, TimeStamp, and (for PointCloudPlane) Label, ReferencePoint, PlaneOrientation
  • FileInfo property is a table with columns: MessageType, DataType, Description, NumMessages, TimeStamps
  • All properties are read-only

Conventions

  • Use tempdir for output paths in examples and tests to avoid permission issues
  • Default to Encoding="binary" for PLY and omit encoding for PCD (default compressed is best)
  • Always use double-quoted strings ("text") and Name=Value syntax — never character vectors or 'Name','Value' pairs
  • Include file extension explicitly in filename — format is determined from extension
  • PLY flattens organized M-by-N-by-3 to unorganized M-by-3; use PCD to preserve organized structure
  • NaN/Inf values are skipped when writing to PLY
  • lasFileWriter only supports unorganized pointCloud objects

References

Load when...Reference
Reading or writing LAS/LAZ files, need filtering NV-pairs, attribute details, or writer propertiesreferences/quick-ref/las-io.md
Reading PCAP files from Velodyne, Ouster, or Hesai sensorsreferences/quick-ref/pcap-readers.md

Copyright 2026 The MathWorks, Inc.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Matlab Read Write Point Cloud File AI skill do?

Read and write 3-D point cloud data using Lidar Toolbox file I/O. Covers PLY, PCD, LAS/LAZ, PCAP (Velodyne/Ouster/Hesai), E57, and IDC (Ibeo) formats. Use when loading point clouds from disk, saving to disk, choosing the correct reader or writer for a file format, extracting or preserving lidar point attributes, reading Ibeo IDC sensor recordings, or converting between formats.

Why use Matlab Read Write Point Cloud File on TypingMind?

Because you install it once and use it with any model. Matlab Read Write Point Cloud File is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Matlab Read Write Point Cloud File in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/image-processing-and-computer-vision/matlab-read-write-point-cloud-file. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Matlab Read Write Point Cloud File?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Matlab Read Write Point Cloud File?

As many as you like. As long as a model supports skills, you can use Matlab Read Write Point Cloud File with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Matlab Read Write Point Cloud File AI skill free?

It is published on GitHub by matlab. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇