No BSD License  

Highlights from
split

4.11111

4.1 | 9 ratings Rate this file 21 Downloads (last 30 days) File Size: 575 Bytes File ID: #4873

split

by Gerald Dalley

 

05 May 2004 (Updated 11 May 2004)

Splits a delimited string into a cell array.

| Watch this File

File Information
Description

Splits a delimited string into a cell array. Example: split('_/', 'this_is___a_/_string/_//') returns {'this', 'is', 'a', 'string', []}.

Tested on MATLAB R12.1 and R13.

Acknowledgements
This submission has inspired the following:
rsplit
MATLAB release MATLAB 6.1 (R12.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (10)
02 Jun 2004 amir k

Works well

21 Sep 2005 Jonathan Moore

convenient

11 Aug 2006 R Hunt

thanks for sharing this

14 Sep 2006 hi choi

Just what I needed. Thanks a lot!

17 Jul 2007 Ricardo Hernandez-Perez

Thanks for sharing this, it's great! It saved a lot of work

27 Dec 2007 saideh rad  
25 Mar 2008 Abel Brown

This rocks! so useful in perl. nice to have it for matlab also! Nice work

24 Sep 2008 cant believe

no support for tabs? wtf?

28 Sep 2008 xiaohui chen  
02 May 2011 Patrick Mineault

A more efficient way of doing the same thing which supports tabs and newlines:

splitchar = '\n'; %Split on newline characters
C = textscan(s,['%s' splitchar]);

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
strings Gerald Dalley 22 Oct 2008 07:19:01
split Gerald Dalley 22 Oct 2008 07:19:01
delimited Gerald Dalley 22 Oct 2008 07:19:01
cell Gerald Dalley 22 Oct 2008 07:19:01
string manipulation Gerald Dalley 22 Oct 2008 07:19:01
utilities Gerald Dalley 22 Oct 2008 07:19:01
split Masahiro 30 Jul 2009 03:22:18
cell Ahmad 23 May 2011 09:04:29
split hebin c 09 Aug 2011 01:49:30

Contact us at files@mathworks.com