LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SquaredDifference.m
1% sd = SquaredDifference(p1, p2)
2%
3% Returns the squared difference between two vectors.
4%
5% Parameters
6% ----------
7% p1 : vector, length M
8% The first vector
9% p2 : vector, length M
10% The second vector
11%
12% Returns
13% -------
14% sd : double
15% The squared difference calculated as
16% `sq=\sum_{i=1}^M (p1_i-p2_i)^2`
17
18function sd = SquaredDifference (p1, p2)
19
20 sd = dot(p1-p2, p1-p2);
21end
22