MATLAB: S-Function PWork pointers and memory allocation error

cs-functionsimulink

Best Answer

The object I was trying to access was being created on the stack and not on the heap. Sorted now.