How to calculate cosine similarity score between two pieces of C code?

1 次查看(过去 30 天)
I am bignner in matlab.I have to calculate the cosine similarity score between two pieces of C code . Is it possible whih matlab? If yes then how?
Please
The example of piece of code is given as follow.
void sumProd1A(int n) {
double sum = 0.0; //C1
double prod = 1.0;
int i;
for (i = 1; i <= n; i++)
{ sum = sum + i;
prod = prod * i;
foo2(sum, prod);}
}
void main()
{
printf("\nsumProd1A_Cordy: %lf ");
sumProd1A(4);
}

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by