Skip to Main Content Skip to Search
Accelerating the pace of engineering and science

 

Database Toolbox

Product Description

Importing Data into MATLAB

The Database Toolbox supports standard SQL commands, including where clauses for further defining the data to be imported. The fetch statement can retrieve all data at once or a subset of the selected rows. This process can be automated if you save the commands in a MATLAB® program file. Once the data is in MATLAB, you can view attributes of the imported data, as well as the data itself, and use MATLAB commands to process the data.

Sample Code

A set of commands used to import a column of data, X, from table Y.

% connect to specified database, specifying username and password connectionA = database (‘database’, ‘user’, ‘password’)

% open cursor and issue SQL statement to select data cursorA = exec(connectionA, ‘select X from Y’)

% retrieve R rows of data cursorA = fetch(cursorA, R)

Contact sales
Free technical kit
Trial software

Get Pricing and
Licensing Options

Free Seminar

Energy Trading and Risk Management with MATLAB new