Adding input data to the block parameter

9 Ansichten (letzte 30 Tage)
FURKAN TULUK
FURKAN TULUK am 12 Aug. 2022
Bearbeitet: Divyam am 18 Sep. 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.

Antworten (1)

Divyam
Divyam am 18 Sep. 2024
Bearbeitet: Divyam am 18 Sep. 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

Kategorien

Mehr zu C Code Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by