title: surface topography Octave
body: <p>I am a newbie to Octave, and really struggle with a Matlab script I was given. I am trying to make it run in Octave. The function is defined as </p>
  
  <pre><code> function terrainParameter = calculateTerrainParameter(surfaceTopography,x2,x3,x4).
  </code></pre>
  
  <p>The inputs x2,x3,x4 are clear. What I have troubles with is x1, the surface Topography. In the script follows: </p>
  
  <pre><code>latitudeStart = surfaceTopography.xllcorner;
  latitudeStep = surfaceTopography.cellsize;
  latitudeStop = surfaceTopography.xllcorner + latitudeStep * (surfaceTopography.ncols - 1);
  
  longitudeStart = surfaceTopography.yllcorner;
  longitudeStep = - surfaceTopography.cellsize;
  longitudeStop = surfaceTopography.yllcorner + latitudeStep * (surfaceTopography.nrows - 1);
  
  [latitudeGrid longitudeGrid] = meshgrid(latitudeStart:latitudeStep:latitudeStop,longitudeStop:longitudeStep:longitudeStart);
  
  altitudeGrid = surfaceTopography.data;
  </code></pre>
  
  <p>Now: the input "surfaceTopography" (=x1), how should that look like? I have an ARC grid (DSM.arc). I managed Octave to read it - without the header (DSM) -and built a 3D mesh. But when I run the script the output reads usually    </p>
  
  <pre><code>matrix cannot be indexed with .
  </code></pre>
  
  <p>when I try "DSM" or "DSM.arc" as input for "surfaceTopography". Or should the mesh (meshgrid) be the surfaceTopography? </p>
  
  <p>I am not sure my question is clear, but I hope it is and someone can help me here.</p>
  
  <p>Thanks in advance, Peter </p>