How to define variable size parameter in s-function
5 次查看(过去 30 天)
显示 更早的评论
Dear Matlab experts,
I'm generating a s-function with tunable Parameters in Matlab Simulink 2012b 32bit. The parameter is a matrix e.g. A=zeros(2,11). In this s-function only one specific line of this matrix will be used with the row selector for futher calculation.
Now I want to use the same s-function with the new parameter A=zeros(20,11). An error Pops up :" Parameter 'A' has to be a [2x11] Array."
How can I define this tunable Parameter to be with variable size, maybe with a maximum size of 20x11, for the Code Generator?
Thank you for your support
0 个评论
回答(1 个)
Nick Choi
2017-10-3
Something to look into would be run-time parameters. The following documentation page provides useful information regarding how to utilize them in S-functions: http://www.mathworks.com/help/simulink/run-time-parameters.html
Additionally, you can execute the following command at the MATLAB command prompt to open example models that contain S-functions that utilize run-time parameters:
>> sfcndemo_runtime
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!