12. Soda ID Sweetness Carbonation Price Soda 1 3.5 4.3 $1.00 Soda 2 5.1 4.1 $1.50 Soda 3 4.2 2.2 $2.00 Soda 4 3.1 4.2 $0.75 Soda 5 6 3.0 $0.50 Sweetness Carbonation Price
13. xlsread(filename) csvread(filename) Sweetness Carbonation Price 3.5 4.3 $1.00 5.1 4.1 $1.50 4.2 2.2 $2.00 3.1 4.2 $0.75 6 3.0 $0.50 Soda Brand Soda 1 Soda 2 Soda 3 Soda 4 Soda 5 [SODAS, BRANDS] = xlsread(filename) Sweetness Carbonation Price
23. The Basic Math Difference in Sweetness Difference in Carbonation Difference in Price Sweetness Carbonation a b A^2 + b^2 = c^3 Distance: (in lots of dimensions)
24. Matlab dsearchn N-Dimensional nearest point search Syntax k = dsearchn(SODAS,IDEALS) rangesearch Find all neighbors specified distance using KDTreeSearcher object Syntax [idx,D]= rangesearch(SODATREE,IDEALS,r)
25. Matlab dsearchn N-Dimensional nearest point search Syntax k = dsearchn(SODAS,IDEALS) knnsearch Find k-nearest neighbors using data Syntax [IDX,D] = knnsearch(SODATREE,IDEALS,r) For single nearest point For More Neighbors (requires a tree)
26. Easy One Match Search dsearchn N-Dimensional nearest point search Syntax I = dsearchn(SODAS,IDEALS)
27. Harder Multi Match Search Building a Tree Sweetness Carbonation Price 3.5 4.3 $1.00 5.1 4.1 $1.50 4.2 2.2 $2.00 3.1 4.2 $0.75 6 3.0 $0.50 SODATREE = kdtreesearcher(SODAS,'distance') All the Sodas
28. Sweetness Carbonation Price 3.5 4.3 $1.00 5.1 4.1 $1.50 4.2 2.2 $2.00 rangesearch Find all neighbors specified distance using KDTreeSearcher object Syntax [I,D]= rangesearch(SODATREE,IDEALS,r) * * r Harder Multi Match Search Getting neighbors Ideal Sodas