I have a nested matrix n
:
n = {{a, b}, {c, d}}
a = {{0, t, q, dh}, {0, 1, 0, th}, {1, 0, 0, sh}}
b = {{0, t, q, dh}, {0, 0, 0, th}, {0, 0, 1, sh}}
c = {{0, t, q, dh}, {1, 0, 1, th}, {0, 0, 0, sh}}
d = {{0, t, q, dh}, {0, 1, 0, th}, {1, 0, 0, sh}}
With thanks to Kuba and Mr.Wizard 'comparison-operation-for-nested-matrices' I could get a combined nested matrix: ncombined (on which a comparison operation was applied)
ncombined= {{
{{0, t, q, dh},
{0, 1, 0, th},
{1, 0, 1, sh}}},
{{{0, t, q, dh},
{1, 1, 1, th},
{1, 0, 0, sh}}
}}
and with thanks to Kgular getting-good-looking-matrix..I could add a vector m
as:
m = {rr, kk}
to the ncombined as bellow:
pp = Transpose[Insert[Transpose[ncombined], Flatten@m, 1]];
ppgoodlook=MapAt[MatrixForm, pp, {{All, All}, {}}]
I am so sorry if my question maybe will not well written while I have so much tried to write it more obviously. Also I will bring the image of the desired result.
question:
Since, number 1
is not repeated in the same elements of a
and b
, also for c
and d
, how can I refer each of 1
in the ppgoodlook
to the main sub_matrices such as a
, b
, c
or d
(from which, 1
is gone to ppgoodlook
) in order to obtain the bellow result (However this referring is regardless to the letters of sub_matrices such as sh
,th
, q
, t
and dh
) :