i want to calculate euclidean distance between dataset with query where dataset (36x9) and query(3x8).
1 view (last 30 days)
Show older comments
This is my formula :
jarak = jarak + sqrt(ZRef{j,1:8}) - ZQuery({j,1:8}.^2;
when I'm running, there is an error Cell contents reference from a non-cell array object.
Thanks you
0 Comments
Answers (2)
Image Analyst
on 4 Mar 2017
ZQuery and ZRef are not cell arrays. Try using parentheses instead of braces, and putting them in the proper locations.
jarak = jarak + sqrt((ZRef(j,1:8) - ZQuery(j,1:8)) .^ 2);
0 Comments
Walter Roberson
on 4 Mar 2017
If you are more or less moving the query over the whole dataset looking for best match, then I suggest using nlfiter if you need to form an explicit euclidean distance. If you are looking for "best match" then I gather that it would typically be computed by cross-correlation.
0 Comments
See Also
Categories
Find more on NaNs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!