title: Detrending fields in a structure with matlab
body: <p>I have 10 fields in a structure, each of which have 1X1 structures, containing 18 fields.  I was wondering how to perform an operation like "detrend" on one of the 10 fields in the original structure.  This would mean detrending each of the 18 fields (these are of different lengths.  That is, I could do the following, but I want to detrend all the chunks at once.  Each chunk is of a different length.</p>
  
  <pre><code>detrend(ship_timeseries_chunks_S.Z180.Chunk1);
  detrend(ship_timeseries_chunks_S.Z180.Chunk2);
  .
  .
  .
  detrend(ship_timeseries_chunks_S.Z180.Chunk18);
  </code></pre>