Octave with Image Package, 25 bytes
@(d)padarray(e(d-2),+~~d) Anonymous function that inputs a vector with the coordinates and outputs an n-dimensional array. Wall and space are respectively 0 and e (equal to 2.71828...)
Note that, when displaying, the first dimension corresponds to the vertical direction.
Explanation
@(d)padarray(e(d-2),+~~d) @(d) % Define anonymous function e(d-2) % N-dim array containing e, with side lengths given by d-2 +~~d % Negate d twice, cast to double: gives vector of N ones (**) padarray( , ) % Add a frame of zeros to (*) with thickness (**) in each dim