Is there way to rewrite natural join of two matrices filled with numbers in terms of ordinary calculus and linear algebra notation (in terms of things like vector products or matrix products, vector addition or matrix addition or something else thought in these courses)? Natural join is $R \bowtie S =\{\, (a, b, c)\mid (a, b) \in S \land (d, c) \in R \land b=d \,\}$. I know that matrices and relations are not same things, so I want matrix function that would act similar to natural join.
As far I have got, is this: $C(1,j)=A(1,j) \land C(2,j)=A(2,j)\land C(3,k)= B(2,k) \land A(2,j)=B(1,k)$, where A and B are matrices corresponding to relations $S$ and $R$, and $C$ is a matrix corresponding to $R \bowtie S$.
UPDATE: IF $R=\{\ (a_{1,1},a_{1,2}), (a_{2,1},a_{2,2}),(a_{3,1},a_{3,2})\}\ $then $A=\begin{pmatrix} a_{1,1} & a_{1,2} \\ a_{2,1} & a_{2,2} \\ a_{3,1} & a_{3,2} \end{pmatrix} $
IF $S=\{\ (b_{1,1},b_{1,2}), (b_{2,1},b_{2,2}),(b_{3,1},b_{3,2})\}\ $then $B=\begin{pmatrix} b_{1,1} & b_{1,2} \\ b_{2,1} & b_{2,2} \\ b_{3,1} & b_{3,2} \end{pmatrix} $
C is matrix, that rows of that corresponds to ordered triples defined by set $\{\, (a, b, c)\mid (a, b) \in S \land (d, c) \in R \land b=d \,\}$
Similarly it is possible to define A, B, C with any number of rows.
How can I define matrix C using ordinary calculus, linear algebra or matrix calculus notation?