matlab-import-export-data

Read and write CSV, Excel, Parquet, JSON, and XML data files in MATLAB.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-import-export-data
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-import-export-data
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/matlab-data-import-and-analysis/matlab-import-export-data
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-import-export-data

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

MATLAB data I/O involves subtle pitfalls: European locale delimiters, silent data corruption (Excel Inf becoming 65535, Parquet integer promotion), misleading error messages, and legacy patterns like fopen/fgetl loops. This Skill provides correct, modern patterns for importing and exporting tabular and structured data while avoiding these traps.

Core Features & Use Cases

  • Format-specific guidance: Correct usage of readtable/writetable, detectImportOptions, readtimetable, readstruct/writestruct, and readdictionary for CSV, Excel, Parquet, JSON, and XML files.
  • Validation and error diagnosis: Post-import checks for silent corruption (NaN columns, 65535 values, int64-to-double promotion) and interpretation of misleading error messages.
  • Locale and URL handling: European delimiter/decimal-separator configuration, reading from URLs and authenticated REST endpoints, and direct reads from compressed archives.
  • Use Case: Import a German semicolon-delimited CSV with comma decimal separators, validate the imported table for missing values, and export the cleaned results to Parquet.

Quick Start

Ask your agent to import a CSV or Excel file into MATLAB using readtable with proper import options and validate the results.

Frequently Asked Questions about matlab-import-export-data

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

FAQPage Schema
How do I read a CSV file into a table in MATLAB?

Use readtable with detectImportOptions to control delimiters, encodings, and variable types. Set TextType to "string" and TreatAsMissing at read time to handle text and missing values correctly without post-import cleanup.

How do I import European-format CSV files with semicolons in MATLAB?

European CSVs use semicolons as delimiters because commas serve as decimal separators. Set Delimiter to ";", DecimalSeparator to ",", and Encoding to "UTF-8" in detectImportOptions before calling readtable.

Why does my Excel data show 65535 or all-NaN columns in MATLAB?

Excel writes Inf and -Inf as 65535, and complex numbers become NaN because Excel cannot store them. Check imported columns for exactly 65535 or entirely NaN values to detect this silent corruption.

Can MATLAB read Parquet files with null integer values?

parquetread promotes integer columns containing nulls to double, which silently loses precision for int64 and uint64 values above 2^53. Use parquetDatastore with ReadSize set to "file" and readall to preserve integer types.

How do I read data from a URL or REST API in MATLAB?

Pass the URL directly to readtable and specify FileType explicitly since MATLAB cannot infer the format from API endpoints. For authenticated endpoints, configure weboptions with header fields and pass them via detectImportOptions.

When should I not use readtable for data import in MATLAB?

Avoid readtable for files too large for memory, where tall arrays or datastores fit better, and for database access via ODBC/JDBC. It also does not cover vehicle log formats, medical imaging formats, or streaming data acquisition.