Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to match string for cell array strmatch() in Matlab
Date: Thu, 4 Dec 2008 17:22:01 +0000 (UTC)
Organization: PhysioSonics Inc
Lines: 12
Message-ID: <gh93jp$s4v$1@fred.mathworks.com>
References: <e4c5e8e5-865e-44b8-b8a2-b2f19f8edb83@20g2000yqt.googlegroups.com> <bfe4a0fb-0fcd-4df2-bb9b-678743c2e104@j39g2000yqn.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228411321 28831 172.30.248.37 (4 Dec 2008 17:22:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 4 Dec 2008 17:22:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1129061
Xref: news.mathworks.com comp.soft-sys.matlab:505016


Xiaoxiao <xiaoxiaoyang@live.com> wrote in message <bfe4a0fb-0fcd-4df2-bb9b-678743c2e104@j39g2000yqn.googlegroups.com>...
> Thank you very much for the help, Stuart. It is very helpful. Here I
> have one more question. Can you tell me why you need to use x{1}
> instead of x directly in the strfind() function? Thanks again.

You might find it less confusing if you first convert your "cell containing an array of cells" into an "array of cells":

u = [v{:}];

Then you can call Stuart's function like this:

cellfun(@(x) ~isempty( strfind(x, 'a') ), u)