Markdown To MATLAB Array

Login

Email
Password

Don't have an account yet?

Go to Sign up

Input Data
Sample {{ showCoderInput ? 'Choose File' : 'Enter Data' }}

                                
Valid Data Invalid Data — Cannot parse as table
Online Table Editor
Row Col Row Col
Transpose Clear Delete Empty Deduplicate
ABC abc Abc
Replace
First Row as Header
{{ displayRows.length }} rows x {{ displayHeaders.length }} columns{{ firstRowAsHeader ? ' (1 header)' : '' }} {{ selectedRows.length > 0 ? selectedRows.length + ' selected' : '' }}
Output Data ({{ matlabFormatDisplayName }})
{{ copied ? 'Copied!' : 'Copy to Clipboard' }} Download File
Properties
Convert Markdown Table to MATLAB Array online — paste, edit, and download.

Data Format:
Variable Name:
Delimiter:
Convert Restart
Insert Row Below
Insert Row Above
Insert Column Right
Insert Column Left
Delete Row {{ contextMenu.row + 1 }}
Delete Column {{ contextMenu.col + 1 }}
Clear Cell
Clear Row
Case sensitive Use regex Cancel Replace All

What Is the Markdown To MATLAB Array Converter?

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.

How to Convert Markdown Tables to MATLAB Arrays?

Step 1: Provide Your Markdown Data

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.

Step 2: Edit in the Online Table Editor

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.

Step 3: Configure MATLAB Settings

In the Properties panel:

SettingAvailable ForDescription
Data FormatAlwaysChoose from Column Cell Array, Cell Array, Matrix, or Struct Array
Variable NameCell Array, MatrixThe MATLAB variable name for the output
DelimiterMatrix onlySeparator between values: Space, Comma, or Semicolon

Step 4: Export

Click Convert to generate MATLAB code. Use Copy to Clipboard or Download File to save as a .m file.

Key Features

  • 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

What the Output Looks Like

Given this Markdown input:

| name  | age | city        |
|-------|-----|-------------|
| Alice | 30  | New York    |
| Bob   | 25  | Los Angeles |

Column Cell Array format (default)

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 (;).

Cell Array format

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.

Matrix format

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.

Struct Array format

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.

Four Data Formats Explained

Column Cell Array

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.

Cell Array

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).

Matrix

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.

Struct Array

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.

Comparison

FormatMixed TypesNamed FieldsMath OpsSingle Variable
Column Cell ArrayYesNoNoNo (one per column)
Cell ArrayYesNoNoYes
MatrixNumbers onlyNoYesYes
Struct ArrayYesYesNoYes

Official reference: MATLAB Data Types

Use Cases: When to Convert Markdown to MATLAB

ScenarioRecommended Format
Import experimental measurementsMatrix
Import labeled sensor readingsStruct Array
Create lookup tablesCell Array
Define test data for scriptsAny format
Set up simulation parametersStruct Array
Import coefficient tablesMatrix
Signal processing dataMatrix
Annotate plots with data tablesColumn Cell Array
Create dataset for curve fittingMatrix
Define material propertiesStruct Array

MATLAB Script Example

% 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);

Matrix Plotting Example

% 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;

Frequently Asked Questions (FAQ)

  • Does this tool upload my files to a server?

    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.

  • What Markdown table formats are supported?

    The tool supports standard pipe-delimited Markdown tables following the CommonMark specification, including tables with or without leading/trailing pipes and alignment indicators.

  • What are the four output formats?

    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.

  • Which format should I use?

    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.

  • Is the output valid MATLAB syntax?

    Yes. The generated code is valid MATLAB R2016b+ syntax. Paste it into any .m file, live script, or the MATLAB Command Window.

  • What happens to non-numeric values in Matrix format?

    Matrix format only includes numeric values. Non-numeric cells are handled according to MATLAB conventions — ensure your input contains only numbers for Matrix output.

  • Can I customize the variable name?

    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.

  • Can I edit the table before converting?

    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.

  • Is there a file size limit?

    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.

Featured Tools

Featured tools that you might find useful.

Popular Tools

List of popular tools that users love and frequently use.

New Tools

The latest tools added to our collection, designed for you.

Topics

The tools grouped by topics to quickly find what you need.
Free online Excel to JSON converter. Transform XLSX, XLS, XLSM files into JSON arrays, objects, or keyed formats instantly in your browser — no upload, 100% private.

Excel To JSON

Free online Excel to JSON converter. Transform XLSX, XLS, XLSM files into JSON arrays, objects, or keyed formats instantly in your browser — no upload, 100% private.
Free Excel to CSV converter. Convert XLSX, XLS, XLSM to CSV instantly in your browser. No upload, 100% private. Edit, transpose, deduplicate before exporting.

Excel To CSV

Free Excel to CSV converter. Convert XLSX, XLS, XLSM to CSV instantly in your browser. No upload, 100% private. Edit, transpose, deduplicate before exporting.
Free online Excel to SQL converter. Generate CREATE TABLE and INSERT statements from spreadsheets for MySQL, PostgreSQL, SQLite, and SQL Server. Supports batch insert, primary keys, and type inference.

Excel To SQL

Free online Excel to SQL converter. Generate CREATE TABLE and INSERT statements from spreadsheets for MySQL, PostgreSQL, SQLite, and SQL Server. Supports batch insert, primary keys, and type inference.
Free online Excel to ASCII table converter with 10 border styles (MySQL, Unicode, reStructuredText, and more). Add code comment wrappers in 8 languages. Supports text alignment. Client-side processing.

Excel To ASCII Table

Free online Excel to ASCII table converter with 10 border styles (MySQL, Unicode, reStructuredText, and more). Add code comment wrappers in 8 languages. Supports text alignment. Client-side processing.