Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Error using ==> cellfun
Date: Fri, 30 Jan 2009 10:50:02 +0000 (UTC)
Organization: Erasmus MC
Lines: 32
Message-ID: <glum0q$1nr$1@fred.mathworks.com>
References: <glud5p$o60$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1233312602 1787 172.30.248.38 (30 Jan 2009 10:50:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 30 Jan 2009 10:50:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 870065
Xref: news.mathworks.com comp.soft-sys.matlab:514929


"Xiao " <viva_paradise@hotmail.com> wrote in message <glud5p$o60$1@fred.mathworks.com>...
> Hi all.                                      
> 
> I got the following error when executing my program
> 
> %Error using ==> cellfun%
> %Input #2 expected to be a cell array, was double instead.%
> 
> How can I correct this error?
> 
> my program is attached as follows:
> 
> Thanks in advance.
> 
> network = cat(3, [   11  12  0;
>                              0   0   11;
>                              0   0   12;
>                              0   0   0;
>                              0   0   0 ], [21  22  0;
>                                               0    0   21;
>                                               0    0   22;
>                                               0    0   0;
>                                               0    0   0]);
> ind = ~cellfun(@isempty,network);
> [rx,cx,dx]=find(ind(:,sum(ind)>1));

"empty" is not the same as "being zero"

find(network ~= 0)

hth
Jos