Multiple s-function blocks produce different outputs.
显示 更早的评论
Hi,
I am building a simulink model which contains a number of S-function blocks (let's say two for simplicity). These blocks all have the same C mex-file, but different parameter values. The problem is now that only one of these two blocks produces a correct output. Even if the parameters and inputs of both blocks are the same, the outputs don't match. (I have stored the parameters in the real work vector.)
Does someone have an idea on what could cause this problem?
Pieter
1 个评论
Babak
2012-11-12
Do the S-functions have tlc files too? Did you create a mask for the S functions? if so different masks or same?
回答(1 个)
Kaustubha Govind
2012-11-12
0 个投票
Are you using static variables in the C code? If so, you need to replace them with work vectors. It might also be a good idea to debug your S-function to find out exactly what is going wrong.
2 个评论
Pieter
2012-11-13
Kaustubha Govind
2012-11-15
Pieter: I don't know what else to suggest other than ask you to try debugging your code to narrow down the issue to specific snippets of code. :(
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink Coder 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!