Path: news.mathworks.com!not-for-mail
From: "P Sherry" <pistolpetesherry@nospam.hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: length of array
Date: Mon, 30 Jul 2007 21:32:28 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <f8lldc$h41$1@fred.mathworks.com>
References: <f8l6hk$epd$1@fred.mathworks.com> <f8le7k$o02$1@fred.mathworks.com>
Reply-To: "P Sherry" <pistolpetesherry@nospam.hotmail.com>
NNTP-Posting-Host: webapp-01-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1185831148 17537 172.30.248.36 (30 Jul 2007 21:32:28 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 30 Jul 2007 21:32:28 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1068203
Xref: news.mathworks.com comp.soft-sys.matlab:421762


> n=cellfun(@length,c(:,2)) 
> Try x=numel(P{2,b}).

both work but think n=cellfun(@length,c(:,2)) works best for what im doing

NEW PROBLEM:

i have a loop for l and want to use it to find a value not already used in the array P{a}. 

i had the following which partly works... som of the time but not all of the time???

for l = 1:N
    if ~any(P{2} == l-1)

is there another form of this? there is also an inner loop i.e. P{2,b} so l-1 cannot = any of {2,:}