Hi
when I build a S-function using S-function Builder, everything compiled successfully. but when I run the model it notifies "Unexpected internal error".
I don't know why it occurs and relates to what.
Appreciate any help...
Inputs (type double) :
1. fraction (size: 1x1)
2. u_n (size: 40x1)
3. T (size: 1x1)
4. b30 (size: 31x1)
Output (C Code):
int_T i;
int_T j;
int_T k = (int_T) T;
int_T frac = (int_T) fraction;
real_T u[200] ={0};
frac = -frac;
if (frac==-1)
{
k=k+1;
frac=2;
}
for (i=0;i<200;i++)
{
u[i] = u_n[i];
}
for (i=0;i<40;i++)
{
for (j=0;j<10;j++)
{
v_n[i] = v_n[i]+u[(i-k+160-j)]*b30[(frac+3*j)]+u[i-k+160+j]*b30[3-frac+3*j];
u[159+i] = v_n[i];
}
}
when I build a S-function using S-function Builder, everything compiled successfully. but when I run the model it notifies "Unexpected internal error".
I don't know why it occurs and relates to what.
Appreciate any help...
Inputs (type double) :
1. fraction (size: 1x1)
2. u_n (size: 40x1)
3. T (size: 1x1)
4. b30 (size: 31x1)
Output (C Code):
int_T i;
int_T j;
int_T k = (int_T) T;
int_T frac = (int_T) fraction;
real_T u[200] ={0};
frac = -frac;
if (frac==-1)
{
k=k+1;
frac=2;
}
for (i=0;i<200;i++)
{
u[i] = u_n[i];
}
for (i=0;i<40;i++)
{
for (j=0;j<10;j++)
{
v_n[i] = v_n[i]+u[(i-k+160-j)]*b30[(frac+3*j)]+u[i-k+160+j]*b30[3-frac+3*j];
u[159+i] = v_n[i];
}
}