How to apply distance formula on n-number of input data sets?

2 次查看(过去 30 天)
Hi there,
I am trying to apply eucledian distance fromula on different data sets but I am confused about the logic.
Let me tell you about the situation first.
let's say I have 5 data sets as follow
data1 = randn(2,11); data2 = randn(2,11); data3= randn(2,11); data4 = randn(2,11); data5 = randn(2,11);
I want the distances to be calculated in the following manner:
({data1, data2},{data1, data3},{data1,data4},{data1,data5},{data2,data3}....... {datan,datan})
I don't know how to do it?
Basically I have around 2 million airfoil shapes and I wanted to calculate the distances between all of them.
I hope you are getting what I am saying!

回答(1 个)

Mandar
Mandar 2023-2-3
The “pdist” function can be a potential workaround to the above issue. The function “pdist” provides the pairwise distance between pairs of observations. Refer the link below to know more about “pdist” function.

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

产品


版本

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by