I have two matrix A
and B
of equal dimensions see below. In A
matrix I have the variables a,b,c,d
which have direct correspondence with matrix B
element by each row. In other words, for first row {a, b, c, d}
we have {2, 9, 6, 7}
, further for each element in both row a=2, b=9, c=6 and d=7
similarly for other rows in both matrix.
A={{a, b, c, d}, {d, c, b, a}, {a, c, b, d}};
B={{2, 9, 6, 7}, {11, 3, 5, 12}, {12, 4, 1, 4}};
After mapping these two matrix, I want to perform simple mathematical operations (addition and subtraction). For example, for first row:
x1=a-d=2-7=-5
y1=b-a=9-2=7
similarly fir second row,
x2=a-d=12-11=1
y2=b-a=5-12=-7
I can map these two matrix by Map[A,B]
, but I don´t know how to map each element of both matrix. Is there a way we can map each element and then by using loop we evaluate a-d, b-a
for each row?
Thanks in Advance
{{a, b, c, d}, {a, b, c, d}, {a, b, c, d}}.{{1, -1}, {0, 1}, {0, 0}, {-1, 0}}
does, and see if you can adapt this to your problem. $\endgroup$(a,b,c,d)
are changing. Further, list manipulationFunction[A] /@ B
gives wrong values. Actually, if we create somehow element by element correspondence then your solution might work. $\endgroup$