Path: news.mathworks.com!not-for-mail
From: "jay vaughan" <jvaughan5.nospam@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: simple struct question
Date: Fri, 9 May 2008 23:49:22 +0000 (UTC)
Organization: harvard
Lines: 17
Message-ID: <g02nu2$4qt$1@fred.mathworks.com>
Reply-To: "jay vaughan" <jvaughan5.nospam@gmail.com>
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 1210376962 4957 172.30.248.37 (9 May 2008 23:49:22 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 9 May 2008 23:49:22 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1215048
Xref: news.mathworks.com comp.soft-sys.matlab:467659


I would like to set all elements for a range of struct
fields to be the same. What I wanted to write was the
following, which MATLAB doesn't like.

A(50:100).f = 5;

I was hoping not to use a loop for this...

for k = 50:100,
    A(k).f = 5;
end


Any ideas?

Thanks,
J