Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: reshape/squeeze for structs?
Date: Mon, 1 Oct 2007 12:41:12 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 34
Message-ID: <fdqpt8$b62$1@fred.mathworks.com>
References: <fdolje$oiq$1@fred.mathworks.com> <fdonsa$ld9$1@fred.mathworks.com>
Reply-To: "David Doria" <daviddoria@gmail.com>
NNTP-Posting-Host: webapp-06-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1191242472 11458 172.30.248.36 (1 Oct 2007 12:41:12 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 1 Oct 2007 12:41:12 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:430824



wow... it's always so easy!

"Tony Fisher" <tonyfisher100@btinternet.com> wrote in
message <fdonsa$ld9$1@fred.mathworks.com>...
> 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
>