This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Import Data Programmatically

Import data from relational database into MATLAB® workspace using command line

Database Toolbox™ enables you to import data into MATLAB using the command line. You can import data from database tables, or write and execute SQL queries and import the results.


connectionRelational database connection
SQLImportOptionsDefine import options for database data
sqliteSQLite connection


expand all

sqlreadImport data into MATLAB from database table
selectExecute SQL SELECT statement and import data into MATLAB
fetchImport data into MATLAB workspace from execution of SQL statement
executeSQLScriptExecute SQL script on database
runstoredprocedureCall stored procedure with and without input and output arguments
sqlinnerjoinInner join between two database tables
sqlouterjoinOuter join between two database tables
databaseImportOptionsDefine import options for database data
getoptionsRetrieve import options for database data
previewPreview eight rows from database using import options
setoptionsCustomize import options for database data
resetReset to default import options for database data
fetchImport data into MATLAB workspace using SQLite connection


SQL Query Basics

Data Import Using Database Explorer App or Command Line

Learn the best way to import data from your database into MATLAB.

Import Data Using Database Tables or SQL Queries

Data Import Memory Management

Save memory when importing data by using functions and the SQLImportOptions object.

Import Data from Database Table Using sqlread Function

Import data from one table or from the result of multiple joins in an SQL query.

Call Stored Procedure That Returns Data

Define a stored procedure in a database and call it using the fetch function.

Working with MATLAB Interface to SQLite

Analyze data without access to a database or driver by using the MATLAB interface to SQLite.