Why does this simple for loop cause run time faults?
I have made a for loop that produces the data of a sine wave and stores the values in an array. The loop is set to execute in the main(). However this seems to break whatever board i use, i have tested on L47RG and the H745i. Any help would be appreciated.
Below is the for loop that is executed in the main.c, main().
N is a defined constant of 100, and TMAX is a defined constant of 1.0
double t[N];
double y[N];
/*data to be fitted*/
for (int i = 0; i < N; i++)
{
double ti = i * TMAX / 100;
double yi = sin(5 * ti + 0.6);
t[i] = ti;
y[i] = yi;
}
