implements Algebraic Grid Generation (Matlab)