clc;
clear all;
close all;

elem_node=importdata('C_elem_uzl.dat'); %elements and its assigned nodes table
elem_node=elem_node(:,11:end);
elemnum=importdata('C_objem.txt');
elemnum=elemnum.data(:,2);

matice = zeros(length(elemnum),9); 

for i = 1:length(elemnum)          
	matice(i,1) = elem_node(i,1);   
	X = 0;
	for j = 1:8
		matice(i,1+j) = elem_node(i,1+j);
		if matice(i,1+j) == X;
			matice(i,1+j) = 0;	
        end;
		X = elem_node(i,1+j);             
    end;
end;

index = matice(:,:) ~= 0;
elem_node=matice(index);  
