function [t_conn] = fully_connected(emesh) % [t_conn] = fully_connected(emesh) % calculates the fully connected triangles (i.e. 2 points) for i=1:length(emesh.t) tnfr{i} = []; tnf{i} = []; for j=1:size(emesh.t,2) [prow, pcol] = find(emesh.t==emesh.t(i,j)); tnfr{i} = [tnfr{i}, prow(prow ~= i)']; end for j=1:length(emesh.tn{i}) if length(find(tnfr{i} == emesh.tn{i}(j))) > 1, tnf{i} = [tnf{i}, emesh.tn{i}(j)]; end end end t_conn=zeros(311,311); for i=1:length(tnf), for j=1:length(tnf{i}), t_conn(i,tnf{i}(j)) = 1; t_conn(i,i) = 1; end; end end