Daniel@0: %function cstr = strsplit(strarr, ch) Daniel@0: % Daniel@0: % FUNCTIONALITY Daniel@0: % Splits string at positions where substring Daniel@0: % occurs. If is not given, then ascii character 10 Daniel@0: % (newline) is the splitting position. Daniel@0: % This would split for example a read-in file into its lines. Daniel@0: % Daniel@0: % INPUT Daniel@0: % strarr string to split Daniel@0: % ch optional, character or substring at which to split, Daniel@0: % default is character ascii 10 = 'newline' Daniel@0: % Daniel@0: % OUTPUT Daniel@0: % cstr cell array of strings, all leading and trailing Daniel@0: % spaces are deleted. Substring ch is removed from string. Daniel@0: % Daniel@0: % EXAMPLES Daniel@0: % a = strsplit('aaa bbb ccc ', ' ') Daniel@0: % Result: a{1}='aaa', a{2}='bbb', a{3}='ccc' Daniel@0: % a = strsplit('user@server', '@') Daniel@0: % Result: a{1}='user', a{3}='server' Daniel@0: % a = strsplit('aabbccddeeffgg', 'dd') Daniel@0: % Result: a{1}='aabbcc', a{2} = 'eeffgg' Daniel@0: % Daniel@0: % RELATED Daniel@0: % strfun, depreciated stringify.m Daniel@0: Daniel@0: % Copyright (C) 2002 Marc Molinari, University of Southampton Daniel@0: % Author: Dr Marc Molinari Daniel@0: % $Revision: 1.1 $ $Date: 2005/04/15 17:12:14 $ $Tag$ Daniel@0: