Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!h2g2000yqg.googlegroups.com!not-for-mail
From: arun <aragorn168b@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: manipulating strings
Date: Wed, 8 Jul 2009 03:38:09 -0700 (PDT)
Organization: http://groups.google.com
Lines: 58
Message-ID: <d9639397-6d06-4e75-89fc-b6e988b1f16d@h2g2000yqg.googlegroups.com>
References: <87c67726-964b-48ce-80f0-a50d24b62cd1@26g2000yqk.googlegroups.com> 
	<h31j1d$b16$1@fred.mathworks.com> <h31nhp$8hb$1@fred.mathworks.com> 
	<h31odt$6aq$1@fred.mathworks.com>
NNTP-Posting-Host: 192.124.26.250
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1247049490 12206 127.0.0.1 (8 Jul 2009 10:38:10 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 8 Jul 2009 10:38:10 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: h2g2000yqg.googlegroups.com; posting-host=192.124.26.250; 
	posting-account=fyqXpgoAAABqt-0BifyaNxmZhzggFACu
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: news.mathworks.com comp.soft-sys.matlab:553698

On Jul 8, 11:21 am, "us " <u...@neurol.unizh.ch> 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,
best,
arun.