Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Concatenate structure fields with empties
Date: Sun, 4 Jan 2009 22:55:03 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 8
Message-ID: <gjreo7$9vs$1@fred.mathworks.com>
References: <gjo71f$ct5$1@fred.mathworks.com> <see-C54CAA.13113803012009@news.frontiernet.net> <gjqtvv$ku0$1@fred.mathworks.com> <see-262854.14274104012009@news.frontiernet.net> <gjr4hu$306$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 1231109703 10236 172.30.248.35 (4 Jan 2009 22:55:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 4 Jan 2009 22:55:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869871
Xref: news.mathworks.com comp.soft-sys.matlab:509780


> 
> emptyIndices = arrayfun(@(x) isempty(x.myField), s);
> 

You can combine this with deal to place NaN in the empty fields.

[s(emptyIndices).myField] = deal(NaN);