From: "Kirk" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how can one index into a cell array of structs?
Date: Fri, 10 Aug 2012 13:26:08 +0000 (UTC)
Organization: University of Minnesota
Lines: 24
Message-ID: <k0325g$rh2$>
References: <k0319f$okg$>
Reply-To: "Kirk" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1344605168 28194 (10 Aug 2012 13:26:08 GMT)
NNTP-Posting-Date: Fri, 10 Aug 2012 13:26:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1161409
Xref: comp.soft-sys.matlab:776151

"Kirk" <> wrote in message <k0319f$okg$>...
> I am trying to produce a map of climate values that are stored in a cell array of structures. For example, from the cell array {}Clim<79x133>, I can retrieve all of a single cell's maximum temperatures (which is a 13680x1 double) with:
> Clim{1,1}.tmax
> This command gives me all 13680 maximum temperature values from the element tmax. I need to grab a single value for that element for all cells in the array (let's say the last value, number 13680 from all cells)...
> I have tried things like 
> Clim{:,:}.tmax(1360,:)
> to no avail...
> Can anyone suggest an approach? 
> Thanks in advance

God am I dense... It seems that I asked this very question 6 months ago. MattJ kindly provided a solution:

tmax_1 = arrayfun(@(i) ClimIn{i}.tmax(1), 1:numel(ClimIn)); 
tmax_1 = reshape(tmax_1, size(ClimIn));

Works well. Sorry