How to define variable size parameter in s-function

4 visualizaciones (últimos 30 días)
Stefan Wahlig
Stefan Wahlig el 29 de Sept. de 2017
Respondida: Nick Choi el 3 de Oct. de 2017
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

Respuestas (1)

Nick Choi
Nick Choi el 3 de Oct. de 2017
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

Categorías

Más información sobre Block and Blockset Authoring en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by