function [vols]= check_vols(simp,vtx); Auxiliary function that calculates the volume of each tetrahedron in the mesh. simp = The simplices vtx = The vertices vols = The array of volumes.
0001 function [vols]= check_vols(simp,vtx); 0002 %function [vols]= check_vols(simp,vtx); 0003 % 0004 %Auxiliary function that calculates the volume of 0005 %each tetrahedron in the mesh. 0006 % 0007 % 0008 %simp = The simplices 0009 %vtx = The vertices 0010 %vols = The array of volumes. 0011 0012 vols = []; 0013 0014 for i=1:size(simp,1) 0015 0016 this_simp = simp(i,:); 0017 0018 t_vtx = vtx(simp(i,:)',:); 0019 0020 t_vm = [ones(4,1),t_vtx]; 0021 0022 t_vol = abs(1/6 * det(t_vm)); 0023 0024 vols = [vols;abs(t_vol)]; 0025 0026 end 0027 0028 0029 0030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0031 % This is part of the EIDORS suite. 0032 % Copyright (c) N. Polydorides 2003 0033 % Copying permitted under terms of GNU GPL 0034 % See enclosed file gpl.html for details. 0035 % EIDORS 3D version 2.0 0036 % MATLAB version 5.3 R11 0037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%