No BSD License  

Highlights from
repfloat

Be the first to rate this file! 1 Download (last 30 days) File Size: 1.43 KB File ID: #6857
image thumbnail

repfloat

by Michael Robbins

 

03 Feb 2005 (Updated 07 Feb 2005)

Replaces a number in a string, while preserving the string length.

| Watch this File

File Information
Description

A CSSM participant wanted to replace the numbers in a cellstring with another set of numbers, but he wanted the length of the cellstring to remain the same.

My solution to a CSSM question used RegExpRep and I thought it might be helpful to post it here so that the formatting is preserved and it's easy to read and use.

It was written for use with MATLAB version 6.5 through 7.0. The 'tokenize' parameter is included for the versions of MATLAB where "tokenize" is not the default behaviour. It will produce warnings in other versions.

The thread is available here:

http://newsreader.mathworks.com/WebX?14@255.5zzka3B6LbU.0@.eefa13f

Newsgroups: comp.soft-sys.matlab
Subject: String repair: poor form?
Message-ID: <h8yKd.2516$Ny6.4373@mencken.net.nih.gov>

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
expression, regexp, regexprep, regular, replace, string, strings, strrep
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.

Contact us