|
From: William P. Y. H. <wil...@gm...> - 2006-01-03 09:22:17
|
On 1/2/06, Alois Schloegl <alo...@tu...> wrote: > William Poetra Yoga Hadisoeseno wrote: > > Concering the additional support of cellstrings, I suggest to changes as > attached. Moreover, the result in > IDX =3D strfind(STR,PATTERN) should return a vector, not a cell with an > vector element. The attached version does this. > Actually, my version returns a vector. It works by 'generalizing' the input, like this: 1. If the first arg is a string or char matrix, then put it into a cell array and take note of this. 2. Now the object we have is a cellstr (otherwise an error would be generated). For every element in the cellstr, check for PATTERN and put the starting indexes in IDX. 3. If the first arg was a string or char matrix, then take the vector inside IDX and assign it to IDX. This way, we can avoid recursion of strfind(). What do you think? > I'll check in the changes into Octave-forge. You can post it to > bug-octave and ask John to include it. > OK :) I fixed the help message and changed isstr to ischar in my version (attached). What do you think about it? -- William Poetra Yoga Hadisoeseno |