I have a cell array (C
) containing 5 matrices. Each matrix represents different set of vectors (i.e. Each matrix has two columns. One is x coordinate; the other is y coordinate. The row number varying depends on the number of vectors)
C{1} = [20x2 double];
C{2} = [23x2 double];
C{3} = [32x2 double] ...
In this case, there are 20 vectors in C{1}; 23 vectors in C{2} and so on. Is there any way (other than one or two for loop)to do the dot product for the two adjacent vectors for each matrix?
C{1} = [2,3; 1,2; 5,4; 8,3; ...]
calculate the dot product for [2,3]&[1,2] then [1,2]&[5,4] then [5,4]&[8,3] and so on.
So at the end, I would expect to get a cell array with 5 cells. Each cell is an [n-1,1] array (n is the length of the matrix).
dots = [5x1 cell].
dots{1} = [19x1 double];
dots{2} = [22x1 double];
dots{3} = [31x1 double] ...