compute transf.-matrix from nodal values to triangle centers values
0001 function C=n2triamat(p,t) 0002 % compute transf.-matrix from nodal values to triangle centers values 0003 np=size(p,2); nt=size(t,2); 0004 A=sparse(ones(3,1)*(1:nt),t(1:3,:),1,nt,np); 0005 B=sparse(1:nt,1:nt,1./sum(A.'),nt,nt); 0006 C=B*A;