writedlm for arrays of dimension 3 or greater

writedlm outputs the newline between slices of an array of dimension 3 or more to the output stream (instead of stdout).
Merge pull request #6956 from ots1/master

writedlm for arrays of dimension 3 or greater