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

Input 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 = STRNCMP(C1,C2,N) performs a case-sensitive comparison between the

first N characters of each element of cell array C1 and the first N

characters of the same element in cell array C2. Inputs C1 and C2 are

equal-size cell arrays of strings. Input C1 and/or C2 can also be a

character array having the same 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 will occur as

needed.

STRNCMP supports international character sets.

See also strcmp, strcmpi, strncmpi, regexp.

Overloaded methods:

opaque/strncmp

Reference page in Help browser

doc strncmp

<strcmpi> - Compare strings ignoring case.

STRCMPI Compare strings ignoring case.

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

(true) if they are the same except for case, and returns logical 0 (false)

otherwise.

TF = STRCMPI(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, except for case, and logical 0 (false) for those elements

that are not. The order of the two input arguments is not important.

TF = STRCMPI(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, except for case, and logical 0

(false) for those elements that are not.

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

needed.

STRCMPI supports international character sets.

See also strcmp, strncmp, strncmpi, regexpi.

Overloaded methods:

opaque/strcmpi

Reference page in Help browser

doc strcmpi

<strncmpi> - Compare first N characters of strings ignoring case.

STRNCMPI Compare first N characters of strings ignoring case.

TF = STRNCMPI(S1,S2,N) performs a case-insensitive comparison between the

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

(true) if they are the same except for letter case, and returns logical 0

(false) otherwise.

TF = STRNCMPI(S,C,N) performs a case-insensitive 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