title: Directional Derivatives of a Matrix
body: <p>I have 40 structures in my Workspace. I Need to write a script to calculate the directional derivatives of all the elements. Here is the code :  </p>
  
  <pre><code>[dx,dy] = gradient(Structure_element_1.value);  
  dxlb = min(min(dx));  
  dxub = max(max(dx));  
  dylb = min(min(dy));  
  dyub = max(max(dy));  
  
  [ddx,ddy] = gradient(gradient(Structure_element_1.value));
  ddxlb = min(min(ddx));  
  ddxub = max(max(ddx));
  ddylb = min(min(ddy));
  ddyub = max(max(ddy));  
  </code></pre>
  
  <p>This is the code for one element. I Need to find out the same for all the 40 elements and then use it later. Can anyone help with this.</p>