No BSD License  

Highlights from
strrepx

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 762 Bytes File ID: #14197

strrepx

by Mathias Benedek

 

08 Mar 2007 (Updated 12 Mar 2007)

Replace string with another in any location of a mixed cell/struct - data structure

| Watch this File

File Information
Description

v = STRREPX(v,s1,s2) replaces all occurrences of the string s1 in the data structure v with the string s2. The new data structure is returned.

It recursively searches all cells and fields of the data structure v for strings and applies the MATLAB function strrep on them.

Useful e.g. for adapting SPM Batch data structures.

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
09 Mar 2007 B. Roossien

Wouldn't the functions 'structfun' and 'cellfun' be more useful instead of the for loops you now use?

Please login to add a comment or rating.
Updates
12 Mar 2007

Code is simplified considering the comment by B. Roossien

Tag Activity for this File
Tag Applied By Date/Time
structures Mathias Benedek 22 Oct 2008 09:03:05
cell arrays Mathias Benedek 22 Oct 2008 09:03:05
strrep Mathias Benedek 22 Oct 2008 09:03:05
replace Mathias Benedek 22 Oct 2008 09:03:05
utilities Mathias Benedek 22 Oct 2008 09:03:05

Contact us at files@mathworks.com