embedded matlab function cause matlab stop

1 Ansicht (letzte 30 Tage)
msh jgtu
msh jgtu am 20 Sep. 2020
Bearbeitet: msh jgtu am 20 Sep. 2020
i use matlab 2015a and it was working fine, when i used embedded matlab function in simulink it cause matlab to stop and give error " matlab has encountered internal problem and needs to close " even when i use example from help
-------------------------------------------------------------
This segmentation violation occurred while executing the
S-function 'sf_sfun' in block 'e'.
A common cause of this segmentation violation is an incorrect
input port direct feedthrough setting. Each input port of the
S-function that is read (accessed) in mdlOutputs and/or
mdlGetTimeOfNextVarHit must specify that it needs its input
signal in these routines by setting direct feedthrough for
these input ports.
Another cause can be incorrect memory accesses which occur
when your code accesses beyond the end of an array. For example
if you access input port 5 and in mdlInitializeSizes specify
that you only have 4 input ports.
To debug your C-MEX S-function, you can enable diagnostics
by compiling the S-function source with the -g flag, e.g.,
mex -g sfunction_name.c

Antworten (0)

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by