Hi, I have a matrix containing coordinates(x,y,z) and I am trying to find the dot product of the elements inside the vector. The matrix looks like this:
% a(x) a(y) a(z)
-0.0022 -0.0131 0.9999 % b(x) b(y) b(z)
-0.8062 0.2794 0.5216 % c(x) c(y) c(z)
-0.9325 0.0547 -0.3570
I want to achieve a dot product matrix of something like this:
a.a a.b a.c b.a b.b b.c c.a c.b c.c
I tried writing a code
Dot_P(1,1)= dot(matrix(1,:),matrix(1,:)); Dot_P(1,2)= dot(matrix(1,:),matrix(2,:)); Dot_P(1,3)= dot(matrix(1,:),matrix(3,:));
but this is hard coding and is not efficient, any help is appreciated!
Best Answer