Database Toolbox 3.5
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 an M-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)