lexcmp

Fast C-style array/string comparison (by lexical ordering)

이 제출물을 팔로우합니다

lexcmp(s1,s2) returns:
-1, if s1<s2
0, if s1=s2
1, if s1>s2
where the comparison is made on the first elements that differ. s1 and s2 can be strings, numeric arrays or other compatible objects (see the help for more details).

Although this has already been done a few times before, this implementation is among the most efficient and the core routine is in a form that easily translates to mex/C (something similar as a built-in function would be nice to have).

The core function is similar to S. Helsen's strcmpc.m with some performance tweaks. The function is vectorized for cell array input. Recent versions allow inf/nan values.

인용 양식

Ben Petschel (2026). lexcmp (https://kr.mathworks.com/matlabcentral/fileexchange/23035-lexcmp), MATLAB Central File Exchange. 검색 날짜: .

도움

도움 받은 파일: Compare Strings (C-convention)

도움 준 파일: String comparison, multisetdiff, jointable

카테고리

Help CenterMATLAB Answers에서 Characters and Strings에 대해 자세히 알아보기

일반 정보

MATLAB 릴리스 호환 정보

  • 모든 릴리스와 호환

플랫폼 호환성

  • Windows
  • macOS
  • Linux
버전 퍼블리시됨 릴리스 정보 Action
1.2.0.0

added support for inf/nan values in arrays and improved help text

1.0.0.0