I have a java code and I want to convert it as matlab code:
public int[] multiplyEncrypted(int[] num1, int[] num2){
int[] result = new int[num1.length + num2.length];
for(int i=0; i < result.length; i++){
result[i] = 0;
}
for(int i=0; i < num1.length; i++){
for(int j=0; j < num2.length; j++){
int index = i + j + 1;
int mult = ((num1[i]) * (num2[j])% M);
result[index] = result[index] + mult;
}
}
return result;
}
I tried to convert it to matlab but I have problem to understand how far the structure and dimensions of both JAVA and matlab works!!
Could anyone help me to solve this?
Best Answer