How to define variable size parameter in s-function
2 ビュー (過去 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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Block and Blockset Authoring についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!