Just wanted to say Thanks for the solution Alois! Struggled a bit with this, while trying to find the magnetic energy of nonlinear steel by integrating over the saturation in matlab.
My 2 cents: The following lines in matlab computes the volume from two imported arrays meshtype and dvol as discussed above (tested to yield the same value as integrating over 1 in comsol):
meshtype(meshtype==3) = 1/2;
meshtype(meshtype==4) = 1/3;
meshtype(meshtype==6) = 1/6;
meshtype(meshtype==9) = 1/2;
volume = meshtype.*dvol;
BR
Magnus
My 2 cents: The following lines in matlab computes the volume from two imported arrays meshtype and dvol as discussed above (tested to yield the same value as integrating over 1 in comsol):
meshtype(meshtype==3) = 1/2;
meshtype(meshtype==4) = 1/3;
meshtype(meshtype==6) = 1/6;
meshtype(meshtype==9) = 1/2;
volume = meshtype.*dvol;
BR
Magnus