Adding input data to the block parameter

1 visualización (últimos 30 días)
FURKAN TULUK
FURKAN TULUK el 12 de Ag. de 2022
Editada: Divyam el 18 de Sept. de 2024
Hello,
I want to take window length parameter in Moving Average Filter Block in Simulink as data input. Because I want to take the window length as a parameter in the code I created in the microcontroller using the embedded coder. How can I do that?
Sincerely.

Respuestas (1)

Divyam
Divyam el 18 de Sept. de 2024
Editada: Divyam el 18 de Sept. de 2024
The "coder.Constant" class can be used in this case to specify the constant input value for code generation.
While generating your C code for the constant window length parameter with value 20 you can execute the following code:
codegen <function name> -config <code configuration> -args {coder.Constant(20)}
For more information regarding the use of "coder.Constant" class for C code generation, refer to this documentation: https://www.mathworks.com/help/coder/ref/coder.constant-class.html?s_tid=doc_ta#:~:text=Generate%20C%20Code%20from%20a%20MATLAB%20Function%20That%20Has%20Constant%20Input

Community Treasure Hunt

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

Start Hunting!

Translated by