Why do I receive unexpected results and/or a segmentation

N
nether_limma · Sep 3, 2021 · 1.9K views
Question
Why do I receive unexpected results and/or a segmentation violation when linearizing a model that contains Embedded MATLAB Function blocks using Simulink Control Design 1.2 (R14SP2)? I have a  Simulink model which contains an Embedded MATLAB Function block. The first inport of this block has a width greater than one (vector or matrix input).   When I linearize this model by using the Linear Analysis GUI ("Tools -> Linear Analysis"), I receive unexpected results. I receive different results if I add intermediate outports on some of the signals. I also experience frequent segmentation violations and/or crashes when linearizing the model or modifying the inports and outports used for linearization. The stack trace of the segmentation violation is as follows:
Expert Answer
Profile picture of Kshitij Singh
Kshitij Singh PhD Expert
Answered Aug 17, 2026
This bug has been fixed in Release 2006a (R2006a). For previous product releases, read below for any possible workarounds:
 
There is a bug in Simulink Control Design 1.2 (R14SP2) in the way that unexpected results are returned and/or a segmentation violation occurs when linearizing models which contain Embedded MATLAB Function blocks whose first inport is of width greater than one.
 
To work around this issue, separate the inputs to the Embedded MATLAB block into multiple inports. The first input must be of width one. To easily view the widths of the input signals, select "Format -> Port/Signal Displays -> Signal Dimensions" from the Simulink and then select "Edit -> Update Diagram".
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!