
Function y = reshapeto2d(x) returns the two-dimensional array y given the multi-dimensional array x. The third and higher dimensions of array x are stacked one below the other. So, the number of elements in the second dimension (i.e. n(2) or number of columns) of x and y are equal, with n = size(x). Therefore, the number of elements in the first dimension (i.e. number of rows) in y equals to prod([n(1),n(3:length(n))]). The array x may be a numeric matrix or a cell-array. Output array y will be of the same type. See also m-file reshapefrom2d.m for the reverse operation. (c) 2026 fabien van mook 2026.08.20 release of this file within package "fvm-valuetocode" under GNU GPLv3+