# COMSOL - 2D box - get for every x an average value over y (line average apply for more lines) [closed]

• I had to do something similar, and the only way I found was to use the mphinterp function provided by Comsol's Matlab API, sample along enough points in y, and add the values up (do this for each x of interest). In general, Matlab API allows you to do a lot more than the Comsol GUI, and getting started with it is a good investment. Especially if you work with complex or large models. – Evgeni Sergeev Jan 30 '14 at 5:17