strncmpiCompares at most
strncmpi(s1, s2, n)s1 and s2 should be arrays of characters.n should be a real integer, not equal to NaN. n <= 0, it always returns true.n is Inf, it compares max(numel(s1), numel(s2)) characters.s1 and s2 are equal up to the n-th character.s1 or s2 has less than n characters, it will be expanded to have n characters by packing trailing whitespaces.s1 and s2 are compared in a case-insensitive manner.s1 and s2 are indexed linearly.s1 or s2 is not a character array.a and b have different sizes. strncmpi compares their first n characters using linear indexing.a=['Ace';'Bdf']
b=['abcdex']
strncmpi(a,b,5)
strncmpi(a,b,6)
a =
Ace
Bdf
b =
abcdex
ans =
1
ans =
0