Accessing and Manipulating Tables in Nelson
Description
Insertion into a Table
To insert new data into a table, use dot notation or curly braces {} for specific element-wise insertion. You can add new rows, columns, or update existing data.
see examples: Adding a New Column and Updating an Existing Element
Extraction from a Table
You can extract specific rows, columns, or individual elements using indexing or by referencing variable names.
see examples: Extracting Specific Columns and Extracting Specific Rows
Removing Data from a Table
In Nelson, you can remove rows, columns, or specific elements from a table by using indexing or the removevars function. Rows or columns can be removed by setting the indices to empty brackets [].
see examples: Removing Rows and Removing Columns
Horizontal Concatenation (horzcat)
You can concatenate tables horizontally (side by side) using the horzcat function. This function combines tables by appending the columns of one table to the columns of another table.
see examples: Horizontal Concatenation
Vertical Concatenation (vertcat)
You can concatenate tables vertically (one below the other) using the vertcat function. This function combines tables by appending the rows of one table to the rows of another table.
see examples: Vertical Concatenation
Convert variable types
You can convert table variables by using the VariableTypes property.
see examples: VariableTypes example
Summary
In Nelson, tables provide a flexible way to store and manipulate heterogeneous data. You can easily insert data, extract parts of the table, and concatenate tables both horizontally and vertically using built-in functionality like dot notation and concatenation functions (horzcat, vertcat), making table manipulation intuitive and powerful for data analysis.
Examples
Adding a New Column
Updating an Existing Element
Extracting Specific Columns
Extracting Specific Rows
Removing a Column
Removing a Row
Horizontal Concatenation
Vertical Concatenation
Convert variable types
See also
table, Direct computation with Table.
History
1.8.0
initial version
1.10.0
VariableTypes property
Author
Allan CORNET
Last updated