compute iterations to calculate pairs of data that do not repeat

1 Ansicht (letzte 30 Tage)
P_L
P_L am 16 Apr. 2019
Kommentiert: P_L am 16 Apr. 2019
Hi there I have 15 sets of x,y,z data points. I want to compute 105 possible combinations of these points using a computational method. I believe I will want to use a loop although I am not sure how to set one up that discards any repeating combinations.
This is the code I have:
% script to caluclate the correlation dimension of points
% with delta[log N_D (R)] / delta (log R) ( taken from Kagan.Y (2007)
% Earthquake spacial distribution: The correlation dimension.
% where
% D = dimensionality = 3-D
% N = total number of earthquake pairs = n(n-1)/2
% R = distance between points = sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2)
N = 15*(15-1)/2 %the number of pairs I can have
% The Data set (15 points)
x_vals=[-9.33203 -9.92969 -9.40234 -9.47266 -8.83984 -9.50781 -10.0703 -9.08594 -9.50781 -10.0352 -9.12109 -9.05078 -9.26172 -9.82422 -10.3516];
y_vals=[27.8633 27.6172 27.6523 27.5117 27.9336 27.6172 27.3359 27.6172 27.6172 27.2305 27.9336 28.0039 27.793 27.7227 26.7734];
z_vals=[10.0098 8.04297 8.97461 7.98086 9.51289 8.04297 10.1133 10.0305 7.96016 7.98086 9.47148 7.77383 8.76758 9.34727 7.79453];
Any help would be much appreciated!

Akzeptierte Antwort

KSSV
KSSV am 16 Apr. 2019
  3 Kommentare
KSSV
KSSV am 16 Apr. 2019
LEt x,y,z be your data
xi = nchoosek(x,2) ;
P_L
P_L am 16 Apr. 2019
Hi KSSV I don't understand, please could you explain more clearly? I need combinations of x,y and z data.
Many thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Earthquake Engineering finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by