Method Reference: string.size

string: sz = size (str)
string: dim_sz = size (str, dim)
string: dim_sz = size (str, d1, d2, …)
string: [rows, columns, …, dim_n_sz] = size (…)

Return the size of a string array.

sz = size (str) returns a row vector with the size (number of elements) of each dimension for the string array str.

dim_sz = size (str, dim) returns the size of the corresponding dimension specified in dim. If dim is a vector, then dim_sz is a vector of the same length and with each element corresponding to a specified dimension. Multiple dimensions may also be specified as separate arguments.

With a single output argument, size returns a row vector. When called with multiple output arguments, size returns the size of dimension N in the Nth argument.

Source Code: string