From: arun <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: manipulating strings
Date: Wed, 8 Jul 2009 03:38:09 -0700 (PDT)
Lines: 58
Message-ID: <>
References: <> 
	<h31j1d$b16$> <h31nhp$8hb$> 
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: 1247049490 12206 (8 Jul 2009 10:38:10 GMT)
NNTP-Posting-Date: Wed, 8 Jul 2009 10:38:10 +0000 (UTC)
Injection-Info:; posting-host=; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) 
	Gecko/20090624 Firefox/3.5,gzip(gfe),gzip(gfe)
Xref: comp.soft-sys.matlab:553698

On Jul 8, 11:21 am, "us " <> wrote:
> "nor ki"
> > where did you find ismembc? is there a place to find undocumented functions?
> it is not an undocumented function...
> rather, look at ISMEMBER
>      edit ismember;
> % and you'll find this at line #121 - 127
> %{
>       % Two C-Helper Functions are used in the code below:
>       % ISMEMBC  - S must be sorted - Returns logical vector indicating which
>       % elements of A occur in S
>       % ISMEMBC2 - S must be sorted - Returns a vector of the locations of
>       % the elements of A occurring in S.  If multiple instances occur,
>       % the last occurrence is returned          
> %}
> % then, being an investigative person, you'll immediately do this
>      which ismembc;
> % MLROOT\toolbox\matlab\ops\ismembc.mexw32     % <- a MEX...
> % and play with it in the command window (timing and so on)
> it's often worthwhile to look at ML stock functions to
> - see how TMW does things (not always optimized...)
> - look for hidden gems...
> us

nor ki,

thank you for your suggestions. They work very well. Now my next
formidable task is to reshape this vector to a 192*240605 matrix. (My
actual task is to parse a file which is 270 MB long line by line and
do these operations. But I found another topic in whice UWE has shown
the fastest way to read a whole file onto a variable using fread and
now, I am trying to remove the unwanted entries and then shape them in
to the desired matrix. The old line-by-line method takes about 30-45
mins on this old computer.. so far, before the reshape step, without
out of memory error, it takes 1.5 mins. let me see!! )

Uwe, yours also works like a charm. I personally dont see a difference
between ismember and ismembc, at least on this machine! :)

Rune, regexp and regexprep both give the "out of memory" error when
used on such long strings on my slowwww computer... (at my work).
I guess, it will be faster and able to be run on my new laptop...
still waiting ........

thanks again guys,