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 into MATLAB Workspace

Import data into MATLAB® workspace using Database Explorer app or command line

Database Toolbox™ enables you to import data into the MATLAB workspace interactively using the Database Explorer app or by using the command line. You can create SQL queries by building them in the Database Explorer app or by writing them using the command line. If you are not familiar with SQL, you can use the command-line functions that import data without specifying an SQL query. You can also customize the options for importing data from a database.

Apps

Database ExplorerConfigure, explore, and import database data

Objects

connectionRelational database connection
SQLImportOptionsDefine import options for database data
sqliteSQLite connection

Functions

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
runsqlscriptRun 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
setoptionsCustomize import options for database data
resetReset to default import options for database data
fetchImport data into MATLAB workspace using SQLite connection

Topics

SQL Query Basics

Data Import Using Database Explorer App or Command Line

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

Database Explorer App

Create SQL Queries Using Database Explorer App

Create SQL queries in the same database, different catalogs or schemas, or different databases.

Command Line

Data Import Memory Management

Save memory when importing data using functions and limiting the number of rows.

Import Data from Database Table Using sqlread Function

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

Call Stored Procedure That Returns Data

Define stored procedures in a database and call them 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.

Related Information