Is it possible to reshape matrices such that
x1 =
1 5
3 4
4 3
7 1
becomes
x2 =
5
NaN
4
3
NaN
NaN
1
or vice versa, where the first column in x1
is an index that corresponds to a row# in x2
?