User`s guide

Importing and Exporting Boolean Data
5-57
Importing and Exporting Boolean Data
In this section...
“Import Boolean Data from Databases” on page 5-57
“Exporting Boolean Data to Databases” on page 5-60
Import Boolean Data from Databases
BOOLEAN data is imported from databases into the MATLAB workspace as data type
logical. This data has a value of 0 (false) or 1 (true), and is stored in a cell array or
structure.
This example imports data from the Invoice table in the dbtoolboxdemo database into
the MATLAB workspace.
1
Set Data return format to cellarray.
2
For Data operation, choose Select.
3
In Data source, select dbtoolboxdemo.
4
In Tables, select Invoice.
5
In Fields, select Paid and InvoiceNumber.
6
Assign the query results to the MATLAB workspace variable D.
7
Click Execute to run the query.
VQB retrieves a 10-by-2 array.
8
Enter D in the Command Window. 10 records are returned:
D =
[ 2101] [0]
[ 3546] [1]
[33116] [1]
[34155] [0]
[34267] [1]
[37197] [1]
[37281] [0]
[41011] [1]