ZURINET
asked on
Compare matrix
Hi all
I have this matrix
double[][] arrayInput = {{1,0,1}};
double [][] arrayWeight = {{0.2,1.5,2.}};
arrayWeight = arrayInput
arrayWeight < arrayInput
arrayWeight > arrayInput
I am looking for a method that can help me compare both values
and return the result
public static double getEculideanDistance(doubl e [][]arrayInput, double [][] arrayWeight)
{
retrun result;
}
Thanks in Advance
I have this matrix
double[][] arrayInput = {{1,0,1}};
double [][] arrayWeight = {{0.2,1.5,2.}};
arrayWeight = arrayInput
arrayWeight < arrayInput
arrayWeight > arrayInput
I am looking for a method that can help me compare both values
and return the result
public static double getEculideanDistance(doubl
{
retrun result;
}
Thanks in Advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what does arrayWeight < arrayInput mean?
ASKER
Hallo Van
Thanks a lot
regards
Thanks a lot
regards
ASKER
Perfect
You are always welcome
matrix is bigger than another, or what os the distance between matrices
if you want to compare them element by element and
calculate sum of squares of the distances that is how you do it:
public static double getEculideanDistance(doubl
double output = 0.0;
for (int row = 0; row < arrayInput.length; row++) {
for (int col = 0; col < arrayInput[row].length; col++) {
output += (arrayInput[row][col]-arra
}
}
return Math.sqrt(output);
}
I'm not quite sure though that to the method it passes dimensions of two dimnsional array correctly,
you can then pass dimensions as integers