Hi
I hava an nodes of elements from text file sorted in array with x,y,z points. I would like to add an extra column which represent counter of the node. Each node needs to be separated by comma.
Ex:
nodes form text file sorted as follow:
2 4 54 3 32 6 98 6 1
I need to add extra column:
1 2 4 5;2 4 3 3;3 2 6 9;4 8 6 1;
also, needs to separated with comma:
1, 2, 4, 5;2, 4, 3, 3;3, 2, 6, 9;4, 8, 6, 1;
I write a code like this:
node = load('nodes.txt') ; % Load nodal coordinates from node.txt
numnode = size(node,1) ;node = [zeros(numnode,1) , node];dlmwrite('nodes.txt',node, 'delimiter', ',')dlmwrite('nodes.txt',node, 'delimiter', '\t')type('nodes.txt')
However, I have an issues writing like this:
- the new column is zeros. and I need it to be counted from 1 to the end of nodes.
- After the file was written it showed as one element reported by comma, while if I open it in excel for example I would like to see it each column in separate line (4 lines).
see the files.
Thank you.
Best Answer