float randomFloat()
{
return (float)rand() / (float)RAND_MAX;
}
int calculateOutput(float weights[], float x, float y)
{
float sum = x * weights[0] + y * weights[1] + weights[2];
return (sum >= 0) ? 1 : -1;
}
The above code is in C#. I need to convert this code into matlab code.I dont think, we can use float and int in matlab. How do I change the code?