Excel To MATLAB Array

Login

Email
Password

Don't have an account yet?

Go to Sign up

{{ workbook ? 'Online Table Editor' : 'Input Data' }}
Change File Enter Data
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
{{ copied ? 'Copied!' : 'Copy to Clipboard' }} Download File
Properties
Convert Excel to MATLAB online — paste, edit, and download MATLAB.

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 a MATLAB Array?

In MATLAB (Matrix Laboratory), everything is a matrix. A MATLAB array is a rectangular grid of values — scalars are 1×1 matrices, vectors are 1×N or N×1 matrices, and tables of data are M×N matrices. MATLAB uses square bracket notation [] to define arrays, with spaces or commas separating columns and semicolons separating rows.

Converting Excel data to a MATLAB array produces a ready-to-paste code block you can drop into MATLAB scripts, Live Editor notebooks, Simulink models, or any MATLAB-based workflow — no readtable() or xlsread() calls required.

MATLAB Matrix Syntax at a Glance

PatternExampleResult
Row vector[1 2 3]1×3 matrix
Column vector[1; 2; 3]3×1 matrix
2D matrix[1 2; 3 4]2×2 matrix
Cell array (mixed types){"Alice", 30; "Bob", 25}2×2 cell array
String array["Alice", "Bob"]1×2 string array

Why Convert Excel to MATLAB Arrays?

  • Embedded data in scripts — Paste arrays directly into .m files, ensuring the analysis is self-contained and reproducible without external file dependencies.

  • Signal processing and control systems — Convert test data, sensor readings, or simulation parameters from spreadsheets into MATLAB matrices for fft(), tf(), or lsim().

  • Machine learning — Generate feature matrices from Excel datasets for use with the Statistics and Machine Learning Toolbox.

  • Unit testing — Create test input matrices from spreadsheet test cases for MATLAB unit test frameworks.

  • Avoid readtable dependency — Skip file I/O entirely by embedding data inline. Useful for deployed MATLAB applications and MATLAB Online.

  • Live Editor notebooks — Embed data arrays directly in Live Scripts for interactive, shareable analyses.

Core Features

  • Drag-and-drop upload — Drop any .xlsx, .xls, or .xlsm file onto the upload zone.

  • Built-in table editor — Modify cell values, add or delete rows and columns, transpose, deduplicate, and apply case transformations before conversion.

  • Multi-sheet support — Switch between worksheets in multi-sheet workbooks via the sheet selector dropdown.

  • First Row as Header toggle — Control whether the first row is treated as column headers or regular data.

  • Find & Replace — Bulk-replace cell values with optional regex and case-sensitive matching.

  • Undo / Redo — Full edit history so you can revert mistakes.

  • Copy to clipboard — One-click copy of the generated MATLAB code.

  • 100% client-side — Your spreadsheet data never leaves your device. No files are uploaded to any server.

How to Convert Excel to MATLAB Array

  1. Upload your file — Drag an .xlsx, .xls, or .xlsm file onto the upload area, or click Click here to choose to browse.

  2. Edit if needed — Use the built-in table editor to modify values, add or remove rows and columns, transpose, deduplicate, or apply case changes.

  3. Click Convert — Press the Convert button in the Properties panel. The MATLAB array output appears in the Output Data area.

  4. Copy the result — Click Copy to Clipboard and paste the MATLAB code into your script or Live Editor.

Output Example

Input spreadsheet (employees.xlsx):

NameDepartmentSalary
AliceEngineering95000
BobMarketing72000
CarolEngineering102000

Generated MATLAB cell array output:

data = {
   "Name", "Department", "Salary";
   "Alice", "Engineering", "95000";
   "Bob", "Marketing", "72000";
   "Carol", "Engineering", "102000"
};

Numeric matrix (numeric columns only):

data = [
   95000;
   72000;
   102000
];

MATLAB Data Structures for Tabular Data

StructureSyntaxBest For
Numeric matrix[1 2; 3 4]Pure numeric data, linear algebra, signal processing
Cell array{"a", 1; "b", 2}Mixed text and numeric data
String array["a", "b"]Text-only data (R2016b+)
Struct arraystruct("name", "Alice")Labeled records with field names
Tabletable(col1, col2)Column-named datasets (R2013b+)

This tool generates cell array syntax by default, which handles mixed text and numeric data from Excel. For pure numeric data, use the output as a numeric matrix by removing the quotes.

MATLAB Matrix Quick Reference

OperationSyntaxResult
Access elementdata(2, 3)Row 2, Column 3
Extract columndata(:, 3)All rows, column 3
Extract rowdata(2, :)Row 2, all columns
Size[r, c] = size(data)Dimensions
Transposedata'Swap rows and columns
Cell accessdata{2, 1}Content of cell (curly braces)

Frequently Asked Questions (FAQ)

  • What file formats does this tool accept?

    The tool accepts Microsoft Excel files in .xlsx, .xls, and .xlsm formats. LibreOffice and Google Sheets files exported as .xlsx also work.

  • Does the tool upload my Excel file to a server?

    No. All processing happens entirely in your browser using client-side JavaScript. Your file never leaves your device. There are no server uploads, transfers, or storage of any kind.

  • Does the tool generate a numeric matrix or a cell array?

    The tool generates cell array syntax using curly braces {}, which handles mixed text and numeric data from Excel. For pure numeric data, remove the quotes to create a standard numeric matrix using square brackets [].

  • What is the difference between () and {} indexing in MATLAB?

    Use data(2, 3) to access a cell (returns a cell). Use data{2, 3} to access the content inside a cell (returns the actual value). This distinction only applies to cell arrays. Numeric matrices use () exclusively.

  • Can I edit the data before converting?

    Yes. After uploading, a full table editor appears. You can modify individual cells, add or delete rows and columns, transpose the table, remove duplicates, apply case transformations (UPPERCASE, lowercase, Capitalize), and perform find-and-replace operations.

  • Does the tool support multi-sheet Excel files?

    Yes. When your workbook contains multiple sheets, a dropdown selector appears in the editor header. Choose the sheet you want to convert.

  • Can I convert numeric cells to MATLAB doubles?

    The converter outputs all cell values as strings (quoted). For numeric data, remove the quotes in the output. MATLAB will interpret unquoted numbers as double by default. Use str2double() for string-to-number conversion at runtime.

  • Is there a file size limit?

    Since processing is entirely client-side, the limit depends on your browser's memory. Most modern browsers handle workbooks with tens of thousands of rows without issues. For very large datasets, consider using MATLAB's readtable() or readmatrix() functions directly.

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.