sounds like you need to have a column for height and width in the cart object and another column for mat size.
then in the eCart add to cart button, set each of these three columns to be editable from a drop down list.
then you could create a calculation like:
(([height]+[mat]) + ([width]+[mat])) * 2