I have 2 vectors x=[0 1 2 0 1 0 3 1 0] and its transposed column vector y=x'
I need to define a new operation , let's say * following the multiplication table underneath
0 1 2 3
1 0 3 2
2 3 0 1
3 2 1 0
For instance under this new * commutative operation
0*1=1*0=1
1*1=0 or
3*2=1 or 2*3=1 or
3*3=0
And I would like to build a matrix A having first row x and first column y where the elements of the matrix would be each the result of individual element x.*y or y.*x but using only vectors x and y and defining the new operation * .
The result should be
A=[0 1 2 0 1 0 3 1 0; 1 0 3 1 0 1 2 0 1; 2 3 0 2 3 2 1 3 2; 0 1 2 0 1 0 3 1 0;1 0 3 1 0 1 2 0 1;0 1 2 0 1 0 3 1 0; 3 2 1 3 2 3 0 2 3;1 0 3 1 0 1 2 0 1;0 1 2 0 1 0 3 1 0]
A =
0 1 2 0 1 0 3 1 0
1 0 3 1 0 1 2 0 1
2 3 0 2 3 2 1 3 2
0 1 2 0 1 0 3 1 0
1 0 3 1 0 1 2 0 1
0 1 2 0 1 0 3 1 0
3 2 1 3 2 3 0 2 3
1 0 3 1 0 1 2 0 1
0 1 2 0 1 0 3 1 0
Best Answer