I seemed to have fixed it by adding the line ssSetInputPortRequiredContiguous(S, 0, 0) to mdlInitializeSizes. The line was added after the setting up the inputs,
static void mdlInitializeSizes(SimStruct *S)
{
ssSetNumSFcnParams(S, 5); /* Number of expected parameters */
if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {
/* Return if number of expected != number of actual parameters */
return;
}
ssSetNumContStates(S, NUMSTATES); // ia,ib,ic,wrad,theta
ssSetNumDiscStates(S, 0);
if (!ssSetNumInputPorts(S, 1)) return;
ssSetInputPortWidth(S, 0, 3);
ssSetInputPortDirectFeedThrough(S, 0, 1);
/*
* Set direct feedthrough flag (1=yes, 0=no).
* A port has direct feedthrough if the input is used in either
* the mdlOutputs or mdlGetTimeOfNextVarHit functions.
*/
ssSetInputPortRequiredContiguous(S, 0, 0);