Go to Sign up
Note: Your files never leave your device. We don't upload, transfer, or store your data.
|
|
|
|
|---|---|---|
|
|
|
The Markdown To MATLAB Array Converter on A.Tools transforms Markdown pipe-delimited tables into valid MATLAB code — cell arrays, matrices, or struct arrays you can paste directly into MATLAB scripts, live scripts, or the Command Window. All processing runs in your browser. No data leaves your device.
MATLAB uses unique data structures that differ from Python, R, and other languages. This tool supports four output formats to match your specific use case: Column Cell Array, Cell Array, Matrix, and Struct Array.
Click Enter Data to paste a Markdown table into the input area, or click Choose File to drag and drop a .md file. Press Sample to load example data.
Once parsed, an interactive spreadsheet appears. Use the toolbar to:
Add or delete rows and columns
Transpose the table (swap rows and columns)
Remove duplicate rows
Delete empty rows and columns
Change text case (UPPERCASE, lowercase, Capitalize)
Find and replace values — supports case-sensitive search and regex
Toggle First Row as Header to define column names
Right-click any cell for context-menu operations.
In the Properties panel:
| Setting | Available For | Description |
|---|---|---|
| Data Format | Always | Choose from Column Cell Array, Cell Array, Matrix, or Struct Array |
| Variable Name | Cell Array, Matrix | The MATLAB variable name for the output |
| Delimiter | Matrix only | Separator between values: Space, Comma, or Semicolon |
Click Convert to generate MATLAB code. Use Copy to Clipboard or Download File to save as a .m file.
Two input modes: Paste Markdown directly or upload a .md file via drag-and-drop
Full table editor: Edit, transpose, deduplicate, find-and-replace before converting
Four output formats: Column Cell Array, Cell Array, Matrix, Struct Array
Custom variable name: Set any valid MATLAB identifier
Matrix delimiter choice: Space, comma, or semicolon
Client-side processing: Files never leave the browser — zero data upload
Undo/Redo: Full edit history with revert support
Context menu: Right-click for quick row/column/cell operations
Header toggle: Treat the first row as column names or regular data
Validation indicator: Real-time feedback on input validity
Given this Markdown input:
| name | age | city |
|-------|-----|-------------|
| Alice | 30 | New York |
| Bob | 25 | Los Angeles |
name = {'Alice'; 'Bob'};
age = {'30'; '25'};
city = {'New York'; 'Los Angeles'};
Each column becomes a separate cell array variable, with values arranged vertically using semicolons (;).
array = {
'Alice', '30', 'New York';
'Bob', '25', 'Los Angeles'
};
The entire table becomes a single 2D cell array. Rows are separated by semicolons, columns by commas.
array = [
30 25;
85 90
];
Matrices contain only numeric values. All non-numeric cells are excluded. The delimiter can be set to space, comma, or semicolon.
data(1).name = 'Alice';
data(1).age = '30';
data(1).city = 'New York';
data(2).name = 'Bob';
data(2).age = '25';
data(2).city = 'Los Angeles';
Each row becomes a struct with fields named after the column headers.
Creates one cell array variable per column. Values are arranged as column vectors using ; separators.
% Best for: importing data column-by-column
column1 = {'Alice'; 'Bob'; 'Charlie'};
column2 = {'30'; '25'; '35'};
When to use: When you need individual variables for each column, or when importing data into MATLAB workspace variables.
Creates a single 2D cell array containing the entire table.
% Best for: mixed-type tabular data
data = {
'Alice', 30, 'New York';
'Bob', 25, 'Los Angeles'
};
When to use: When you need the entire table as a single variable, or when cells contain mixed types (strings and numbers).
Creates a numeric matrix using square brackets. Only numeric values are included.
% Best for: pure numeric data (measurements, signals, coordinates)
matrix = [
1.0 2.0 3.0;
4.0 5.0 6.0
];
When to use: When all data is numeric and you need to perform mathematical operations, matrix algebra, or plotting.
Creates an array of structs where each row is one struct with named fields.
% Best for: labeled records with named fields
record(1).name = 'Alice';
record(1).score = 95;
record(2).name = 'Bob';
record(2).score = 88;
When to use: When each row represents a record with named fields, similar to a database row or JSON object.
| Format | Mixed Types | Named Fields | Math Ops | Single Variable |
|---|---|---|---|---|
| Column Cell Array | Yes | No | No | No (one per column) |
| Cell Array | Yes | No | No | Yes |
| Matrix | Numbers only | No | Yes | Yes |
| Struct Array | Yes | Yes | No | Yes |
Official reference: MATLAB Data Types
| Scenario | Recommended Format |
|---|---|
| Import experimental measurements | Matrix |
| Import labeled sensor readings | Struct Array |
| Create lookup tables | Cell Array |
| Define test data for scripts | Any format |
| Set up simulation parameters | Struct Array |
| Import coefficient tables | Matrix |
| Signal processing data | Matrix |
| Annotate plots with data tables | Column Cell Array |
| Create dataset for curve fitting | Matrix |
| Define material properties | Struct Array |
% experiment_data.m
data(1).subject = 'Alice';
data(1).reaction_time = '245';
data(1).accuracy = '0.95';
data(2).subject = 'Bob';
data(2).reaction_time = '312';
data(2).accuracy = '0.88';
% Extract for analysis
reaction_times = [str2double({data.reaction_time})];
accuracies = [str2double({data.accuracy})];
mean_rt = mean(reaction_times);
mean_acc = mean(accuracies);
fprintf('Mean RT: %.1f ms\n', mean_rt);
fprintf('Mean Accuracy: %.2f\n', mean_acc);
% plot_data.m
coords = [
1.0 2.5;
2.0 4.1;
3.0 5.8;
4.0 8.2;
5.0 10.1
];
x = coords(:, 1);
y = coords(:, 2);
plot(x, y, 'o-');
xlabel('X');
ylabel('Y');
title('Measurement Data');
grid on;
No. All file parsing and conversion runs in your browser using JavaScript. Your data stays on your device. A.Tools never receives, stores, or transmits your file contents.
The tool supports standard pipe-delimited Markdown tables following the CommonMark specification, including tables with or without leading/trailing pipes and alignment indicators.
Column Cell Array creates one cell array per column. Cell Array creates a single 2D cell array. Matrix creates a numeric matrix (numbers only). Struct Array creates structs with named fields from column headers.
Use Matrix for pure numeric data when you need math operations. Use Struct Array for labeled records with named fields. Use Cell Array for mixed-type data in a single variable. Use Column Cell Array when you need separate variables per column.
Yes. The generated code is valid MATLAB R2016b+ syntax. Paste it into any .m file, live script, or the MATLAB Command Window.
Matrix format only includes numeric values. Non-numeric cells are handled according to MATLAB conventions — ensure your input contains only numbers for Matrix output.
Yes. Enter any valid MATLAB identifier in the Variable Name field (available for Cell Array and Matrix formats). MATLAB variable names should start with a letter and contain only letters, numbers, and underscores.
Yes. After parsing, the full table editor lets you modify cells, add or remove rows and columns, transpose, deduplicate, change text case, and find-and-replace values.
Processing is client-side, so the limit depends on your browser's memory. Tables with tens of thousands of rows work reliably on modern browsers.