Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Combine strings, or merge two tables or timetables by rows using key variables

concatenates
the strings in `newStr`

= join(`str`

)`str`

, placing a space character between
consecutive strings, and returns the result as a string array.

If

`str`

is a`1`

-by-`N`

or an`N`

-by-`1`

string array, then`newStr`

is a string scalar.If

`str`

is an`M`

-by-`N`

string array, then`newStr`

is an`M`

-by-`1`

string array.

For a string array of any size, `join`

concatenates
strings along the last dimension of `str`

with a
size that does not equal `1`

.

combines
the strings in `newStr`

= join(`str`

,`delimiter`

)`str`

and places the elements of `delimiter`

between
the strings instead of a space character.

If the `delimiter`

argument is an array of
different delimiters, and `str`

has `N`

elements
along the dimension that is joined, then `delimiter`

must
have `N-1`

elements along the same dimension. The
other dimensions of `delimiter`

must have either
a size of `1`

or the same size as the corresponding
dimension of `str`

.

merges
tables `tblC`

= join(`tblA,tblB`

)`tblA`

and `tblB`

by matching
up rows, using all the variables with the same names as key variables. The key values must be common
to both `tblA`

and `tblB`

, but can
appear in different orders.

`join`

retains all the variables from `tblA`

and
appends the corresponding contents from the nonkey variables of `tblB`

.

If both `tblA`

and `tblB`

are
timetables, then the key variables are the vectors of row times from `tblA`

and `tblB`

.
If `tblA`

is a timetable and `tblB`

is
a table, then the key variables are all the variables from `tblA`

and `tblB`

with
the same names. The output argument, `tblC`

, is a
timetable that has the same row times as `tblA`

.
If `tblA`

is a table, then `tblB`

cannot
be a timetable.

joins
the tables or timetables with additional options specified by one
or more `tblC`

= join(`tblA,tblB`

,`Name,Value`

)`Name,Value`

pair arguments.

For example, you can specify which variables to use as key variables.

Was this topic helpful?