Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
18
Добавлен:
09.02.2015
Размер:
195.07 Кб
Скачать

In arrays s1, s2, ..., sn. Inputs can be combinations of single

strings, strings in scalar cells, character arrays with the same number

of rows, and same-sized cell arrays of strings. If any input is a cell

array, COMBINEDSTR is a cell array. Otherwise, COMBINEDSTR is a

character array.

Notes:

For character array inputs, STRCAT removes trailing ASCII white-space

characters: space, tab, vertical tab, newline, carriage return, and

form-feed. To preserve trailing spaces when concatenating character

arrays, use horizontal array concatenation, [s1, s2, ..., sN].

For cell array inputs, STRCAT does not remove trailing white space.

When combining nonscalar cell arrays and multi-row character arrays,

cell arrays must be column vectors with the same number of rows as the

character arrays.

Example:

strcat({'Red','Yellow'},{'Green','Blue'})

returns

'RedGreen' 'YellowBlue'

See also cat, cellstr.

Overloaded methods:

cell/strcat

Reference page in Help browser

doc strcat

<strcmp> - Compare strings.

STRCMP Compare strings.

TF = STRCMP(S1,S2) compares the strings S1 and S2 and returns logical 1

(true) if they are identical, and returns logical 0 (false) otherwise.

TF = STRCMP(S,C), compares string S to each element of cell array C,

where S is a character vector (or a 1-by-1 cell array) and C is a cell

array of strings. The function returns TF, a logical array that is the

same size as C and contains logical 1 (true) for those elements of C

that are a match, and logical 0 (false) for those elements that are not.

The order of the two input arguments is not important.

TF = STRCMP(C1,C2) compares each element of C1 to the same element in C2,

where C1 and C2 are equal-size cell arrays of strings. Input C1 and/or C2

can also be a character array having the number of rows as there are

cells in the cell array. The function returns TF, a logical array that

Is the same size as c1 or c2, and contains logical 1 (true) for those

elements of C1 and C2 that are a match, and logical 0 (false) for those

elements that are not.

When one of the inputs is a cell array, scalar expansion occurs as

needed.

STRCMP supports international character sets.

See also strncmp, strcmpi, strfind, deblank, regexp.

Overloaded methods:

opaque/strcmp

Reference page in Help browser

doc strcmp

<strncmp> - Compare first N characters of strings.

STRNCMP Compare first N characters of strings.

TF = STRNCMP(S1,S2,N) performs a case-sensitive comparison between the

first N characters of strings S1 and S2. The function returns logical 1

(true) if they are the same and returns logical 0 (false) otherwise.

TF = STRNCMP(S,C,N) performs a case-sensitive comparison between the

first N characters of string S and the first N characters in each element

of cell array C. Input S is a character vector (or 1-by-1 cell array), and

Соседние файлы в папке Библиотеки Matlab