Hi I have a problem considering calculating a squared function of a grid
so I have 2 vectors X=rand(N,D) and Y=rand(M,D)
I want to generate a function that returs a matrix s.t.
r2(i,j) = (X(i,:)-Y(j,:))*L*(X(i,:)-Y(j,:))';
is there a way to vectorize this cleverly?
It needs to run in Simulink (code generation)