strpat: a pedestrian, exactly matching pattern finder / replacer
by us
20 Mar 2002
(Updated 05 Jul 2006)
Code covered by the BSD License
finds and/or replaces an exactly matching pattern in a string or a numeric array
Download Now
|
Watch this File
|
| File Information |
| Description |
STRPAT finds and/or replaces an EXACTLY matching pattern in a string or numeric array.
EXAMPLES
- strings
strpat('aa_a_aaa_aa','aa','X')
X_a_aaa_X
strpat('aa_a_aaa_aa','a','XXX')
aa_XXX_aaa_aa
- as opposed to
strrep('aa_a_aaa_aa','a','XXX')
XXXXXX_XXX_XXXXXXXXX_XXXXXX
- double array
strpat([[1:3] pi [5:7]],pi,nan)
1 2 3 NaN 5 6 7
strpat(pi*[1:6],[4*pi 5*pi],[])
3.1416 6.2832 9.4248 18.85
strpat(pi*[1:6],[4*pi 5*pi],[nan inf -inf nan])
3.1416 6.2832 9.4248 NaN Inf -Inf NaN 18.85
strpat(pi*[1:6],[4*pi 5*pi],[1:3])
3.1416 6.2832 9.4248 1 2 3 18.85 |
| MATLAB release |
MATLAB 6.1 (R12.1)
|
| Zip File Content |
|
| Other Files |
strpat13.m, strpat.m
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (2) |
| 06 Sep 2007 |
Leandro Navarro
|
|
|
| 19 Apr 2008 |
Carlos Adrian Vargas Aguilera
|
|
|
| Updates |
| 18 Feb 2003 |
simply changed submission name! |
| 18 Feb 2003 |
adjusted use of LOGICAL to new def in R13 |
| 19 May 2003 |
enhanced help |
| 21 May 2003 |
enhanced help |
| 03 Jan 2006 |
returns an error message if it does not find an exactly matching pattern; version tag 30-Dec-2005 18:44:23 |
| 05 Jul 2006 |
changed engine for r14/r2006 versions, which runs much faster (no EVAL!). the old version has been added as STRPAT13. version tag 05-Jul-2006 16:12:19 |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com