# Returns the thickness for layer #i ################################################# function [ d ] = dz( i ) global nlayers if ( i == 1 ) d = z(1); elseif ( i < nlayers ) d = z(i) - z(i-1); else d = z(nlayers) - z(nlayers-1); endif endfunction