MATLAB: Does the model crash when I have multiple inputs to a Scope block in Simulink 5.1 (R13SP1)

inputslimitmemorynscopesegvshowsimulink

I have created a Simulink model in Simulink 5.1(R13SP1) but I receive the following error in a GUI:
Memory allocation error
and MATLAB produces the following error when I attempt to run the model:
------------------------------------------------------------------------
Segmentation violation detected at Fri Aug 13 09:48:14 2004
------------------------------------------------------------------------
<snip>
Stack Trace:
[0] libmx.dll:_mxArrayToString(0, 0x28314020, 1, 0) + 9 bytes
[1] simulink.dll:struct slErrMsg_tag * __cdecl AddTitlesToStructLogVarSignalsField(struct slBlock_tag const *,struct ScopeRec_tag const *)(0x28314020, 0x283143c0, 0x284c2b40, 0x28314020) + 165 bytes
[2] simulink.dll:struct slErrMsg_tag * __cdecl ScopeTerminateFcn(struct slBlock_tag *,struct slSimBlock_tag *)(0x28314020, 0x282b9cf0, 0x28314020, 0x284c2b40) + 242 bytes
[3] simulink.dll:_BlockTerminate(0x284c2b40, 0x283e6ff8, 0x27e31228, 0) + 27 bytes
[4] simulink.dll:_BdTerminateFcn(0x27e31228, 0x00de86f4, 0x7a28fd79, 0x27e31228) + 199 bytes
[5] simulink.dll:_ModelTerminate(0x27e31228, 0x00de8720, 0, 0xffffffff) + 42 bytes
[6] simulink.dll:_StepMenuSim(0x282b9cf0, 0, 0x282b9cf0, 0x00de8724) + 585 bytes
[7] simulink.dll:_sleModelExecutionInterface(0x282b9cf0, 5, 0x00de8720, 0x282804bc) + 153 bytes
[8] simulink.dll:void __cdecl sluiWorkProcSimStep(void *)(0x282b9cf0, 0, 0x77d46494, 0x26

Best Answer

We have verified that there is a bug in Simulink 5.1 (R13SP1) in the way that scope windows handle more than six signals. A segmentation violation results if the scope window is too small to display all of its inputs. The default scope can display six signals.
Currently, to work around this issue, if you need to display more than six signals on a scope, enlarge the scope's figure window before setting the number of input ports.