User`s guide
7 Functions — Alphabetical List
7-132
821
Calculate the sum of the March sales and assign the result to the variable sumA.
sumA = sum(AA(:))
sumA =
14606
Assign the month and sum of sales to a cell array to export to a database. Put the month
in the first cell of data.
data(1,1) = {'March'}
data =
'March'
Put the sum in the second cell of data.
data(1,2) = {sumA}
data =
'March' [14606]
Define the names of the columns to which to export data. In this example, the
column names are Month and salesTotal, from the yearlySales table in the
dbtoolboxdemo database. Assign the cell array containing the column names to the
variable colnames.
tablename = 'yearlySales';
colnames = {'Month','salesTotal'};
Access the status of the AutoCommit database flag. This status determines whether the
exported data is automatically committed to the database. If the flag is off, you can
undo an update; if it is on, data is automatically committed to the database.
conn.AutoCommit
ans =
on
The AutoCommit flag is set to on, so the exported data is automatically committed to the
database.