version 0.0.5-alpha
This commit is contained in:
@@ -21,6 +21,23 @@ function refractoryStatus!(refractoryCounter, refractoryActive, refractoryInacti
|
||||
end
|
||||
end
|
||||
|
||||
function frobenius_distance(A, B)
|
||||
# Check if the matrices have the same size
|
||||
if size(A) != size(B)
|
||||
error("The matrices must have the same size")
|
||||
end
|
||||
# Initialize the distance to zero
|
||||
distance = 0.0
|
||||
# Loop over the elements of the matrices and add the squared differences
|
||||
for i in 1:size(A, 1)
|
||||
for j in 1:size(A, 2)
|
||||
distance += (A[i, j] - B[i, j])^2
|
||||
end
|
||||
end
|
||||
# Return the square root of the distance
|
||||
return sqrt(distance)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -59,13 +76,6 @@ end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user