About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

scripts default iconstrncmpr (Scripts) Publisher's description

Compare last N chars of strings or cell strings

Compare last N chars of strings or cell strings

Input and output equal Matlab's STRNCMP/STRNCMPI, but the strings are compared from right to left.

T = strncmpr(S1, S2, N) or T = strncmpir(S1, S2, N)
S1, S2: Strings or cell strings.
N: Number of characters to compare.
T: Logical array, TRUE if the last N characters are equal, FALSE otherwise.
For STRNCMPIR the case is ignored.

Comparing just two strings in the backward direction can be done in Matlab with a fair efficiency. But for cell strings, this C-Mex is much faster than equivalent Matlab methods: e.g. 3% processing time for comparing a string with a {1 x 100} cell, 1% for {1 x 1000}. I apply it to identify the extensions of file names stored in cell strings.
Call the unit-test function Teststrncmpr to check validity and speed.

Tested: Matlab 6.5, 7.7, 7.8, WinXP, compatibility to Linux and OS-X assumed.
Compiler: LCC2.4/3.8, BCC5.5, OpenWatcom 1.8, MSVC 2008.
It is assumed that wchar_t has the same size as mxChar.
Pre-compiled Mex: http://www.n-simon.de/mex

I'd appreciate suggestions for improvements and bug reports sent through email - thanks

System Requirements:

MATLAB 7.8 (R2009a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

strncmpr (Scripts) Tags:

Click on a tag to find related softwares

Is strncmpr (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.