Consider the following functions:
f[x_]:= {{Im[x], Re[x]}, {Re[x], Im[x]}};
g[x_]:= {{Im[x],0},{0,0}}
When applying each of the functions to the list of lists {{1,2,3}}
, it yields the results
{{{{0, 0, 0}, {1, 2, 3}}, {{1, 2, 3}, {0, 0, 0}}}}
{{{{0, 0, 0}, 0}, {0, 0}}}
The problem with the second solution is that some entries are numbers, i.e. 0, even though they should be lists.
Considering that I wish to use something like f /@ listoflists
(which means I cannot simply edit each of the lists): how can I obtain a result where instead of 0 there is a list of 0s for all entries of the matrix?
Edit: fixed some typos and made the objective clearer.
g[{{1,2,3}}]
? $\endgroup$