I have a list called matcoeffE
which has dimensions {10, 9, 7, 2}
. However, I want to build a matrix with dimensions {180,7}
and then export it as an Excel file. At the first step I used:
newmat = FlattenAt[matcoeffE, Transpose[{Range[10]}]];
so dimensions of newmat
became {90, 7, 2}
. After that I have to flatten 2 (2*90) and get a new matrix which has dimensions {180,7}
which produces an Excel file with 190 rows and 7 columns (in a single sheet). My mean is: newmat
has 90 rows and 7 columns which each column has two numbers in it. I want to second number of each this two-member list goes to the next row (namely each second member is placed under the first member), so that the dimensions will be {180,7}
. I tried to show my mean schematically as follows:
I tried Splice
for example, but it didn't work. In fact I always have a problem with flattening the nested list. How can I solve my problem? Is there a simple and general way to flatten nested lists?
newmat = ArrayReshape[matcoeffE, {90, 7, 2}];
but I do not understand the rest of your question now. $\endgroup$