Sqlite Toolkit - dbtable


: table = dbtable()
: table = dbtable (var1, … varn)
: table = dbtable (… propertyname, propertyvalue)

Create a table of data

dbtable is a basic implementation of a table type to avoid dependencies on other packages.

Inputs

var1varn

Variables or data to be used as the column data of the table. When the input is a variable, the variable name will be used as the column name, otherwise the columns will be Var1 … VarN.

propertyname, propertyvalue

Property name/value pairs, where known property names are:

VariableNames

A cell string matching the number of input columns with the name to use for the

DimensionNames

A cell string matching of length 2 for using as dimension access. If not specified it will be "Rows" and "Variables".

Outputs

table

a dbtable object

Object Properties

A dbtable object has the following properties:

Properties

A table properties struct.

The table struct includes fields:

Description

Text table description

DimensionNames

Cell array of Row and Variable dimension names

VariableNames

Cell array of variable (column) names

UserData

User data value

Examples

Directly create a 2 column table from input of each column

 
 t = dbtable([0;1;3], [2;4;6]);
 
 

Directly create a 2 column table from input of each column, and specify variable names

 
 t = dbtable([0;1;3], [2;4;6], "VariableNames", {'Variable1', 'Variable2'});
 
 

Create a 2 column table from 2 variables V1, V2

 
 V1 = [0;1;3];
 V2 = [2;4;6];
 t = dbtable(V1, V2);
 
 

See also: readdbtable, struct2dbtable.