How can I distinguish between array structure in JAVA and Matalb? (code conversion)
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on Call Java from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!