Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: avoiding loop for defining all elements of a structure ??
Date: Sun, 26 Jul 2009 22:42:02 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 20
Message-ID: <h4im3q$kp3$1@fred.mathworks.com>
References: <h4ijsj$pq2$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1248648122 21283 172.30.248.35 (26 Jul 2009 22:42:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 26 Jul 2009 22:42:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:558463


"Juliette Salexa" <juliette.physicist@gmail.com> wrote in message <h4ijsj$pq2$1@fred.mathworks.com>...
> I have a structure with 25 entries:
> 
> a(1).start
> a(2).start 
> ...
> a(25).start
> 
> I want to define all of these to be zeros(1,5)
> 
> But a(:).start=zeros(1,5) doesn't work
> 
> Is there a way to do this WITHOUT loops or converting to cells or matrices ??

a hint:

     help deal;
     help struct;     % <- look at the CELL mode

us