Without implementing something to draw the rectangle and display the result, you can get this with an extra step or two using brushing:
mesh(peaks, 'FaceColor', 'flat')
click and drag to select a region, it will show up as red
right click and choose 'Export brushed'
Choose a variable name or use the default, now the data is available in the command window