How can I distinguish between array structure in JAVA and Matalb? (code conversion)
Ältere Kommentare anzeigen
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?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Call Java from MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!