String comparison

Compares 2 strings. Output is identical to that of C string library.
1,1K descargas
Actualizado 10 abr 2016

Ver licencia

Compares 2 strings, str1 and str2 and return -1 if str1 < str2, 0 if str1==str2 and 1 if str1 > str2. output is identical to that of C string library.
Same idea as files listed in acknowledgments. The difference is that this implementation is faster since it uses mex function.
Type mex strcmpC.c at the MATLAB prompt to generate the mex file. Then call strcmpC like any MATLAB function.
Example usage:
strcmpC('1234','2345535')
ans =
-1
Source code heavily references a mex example. See mxmalloc.c.
Type the following command in MATLAB prompt to see mxmalloc.c
edit([matlabroot '/extern/examples/mx/mxmalloc.c']);

Citar como

ChinSoon Lim (2024). String comparison (https://www.mathworks.com/matlabcentral/fileexchange/23375-string-comparison), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2008a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Characters and Strings en Help Center y MATLAB Answers.
Agradecimientos

Inspirado por: Compare Strings (C-convention), lexcmp

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0

submit another update that removes the GNU License statement from your Zip as requested by admin
Updated as requested by admin

submit another update that removes the GNU License statement from your Zip as requested by admin