From: Erik de Boer on
Hello all,

To analyse a fracture mechanics problem I'm using a FEM program that requires an imported mesh (set of nodes and coordinates + their connectivity). I've written a matlab script to create this mesh array.

The FEM program can read the array from a .txt file. For the program to be able to read it, the vertical offset between the last character in column n and the decimal separartor of culumn n+1 has to be 5 spaces. Like this:

24 9.0000 6.0000
25 0 0
30 1.2857 -0.4286
31 3.8571 -1.2857

Up to now I wasn't able to do this, using dlmwrite and fprintf. Admittedly, I'm not very familiar with these commands. So my question is: how do I write my matlab data to a .txt file with fixed no. of spaces between decimal seperator of consecutive columns?

I hope someone can help me with this. Thanks!

Erik
From: Erik de Boer on
my example was ruffled up a bit after posting. I'll give another one:
[...] represents a space
[][][][-][0][.][1][2][3][][][1][2][3][.][0][0][0]
There's 5 spaces from 0 to 1st decimal point and from 1st to 2nd.