Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: reshape/squeeze for structs?
Date: Sun, 30 Sep 2007 17:54:18 +0000 (UTC)
Organization: Univ of Liverpool
Lines: 29
Message-ID: <fdonsa$ld9$1@fred.mathworks.com>
References: <fdolje$oiq$1@fred.mathworks.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 1191174858 21929 172.30.248.37 (30 Sep 2007 17:54:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 30 Sep 2007 17:54:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1130437
Xref: news.mathworks.com comp.soft-sys.matlab:430745



How about?

ceri=[a.yesno] ?

"David Doria" <daviddoria@gmail.com> wrote in message 
<fdolje$oiq$1@fred.mathworks.com>...
> I simply want to count the number of 1's in a specific 
field
> of a struct, like this
> 
> a(1).yesno=1;
> a(2).yesno=1;
> a(3).yesno=0;
> 
> if i lookat
> 
> a.yesno
> 
> i see there are two 1's and one 0.
> 
> how can i put these into a vector so i dont have to count 
in
> a loop?  Reshape and Squeeze are giving me grief because
> this is a struct.
> 
> Thanks,
> 
> David