How can I distinguish between array structure in JAVA and Matalb? (code conversion)
古いコメントを表示
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?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Call Java from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!