How can I get the windowlength parameter of the dsp.MovingAverage system object as a variable?

조회 수: 12 (최근 30일)
Hello, I want to generate c code using the dsp.MovinAverage system object and I want to get the window length parameter as a variable. Parameter is set to nontunable and window length must be constant.
I made code generation by defining the window length value as a variable in the model workspace in the moving average block in the simulink.
Is it possible to do this with the dsp.MovinAverage system object in Matlab?
Thank you.
  댓글 수: 1
David Fink
David Fink 2022년 9월 14일
I believe I understand what you're asking, but please confirm that my understanding below is correct:
The goal is to create a dsp.MovingAverage object whose WindowLength property is an input variable to the generated C code.
Is this correct?

댓글을 달려면 로그인하십시오.

답변 (1개)

FURKAN TULUK
FURKAN TULUK 2022년 9월 15일
이동: David Fink 2022년 9월 15일
Thank you for your answer, I solved the problem. I was able to assign a variable to the window length parameter with the coder.Constant() command.

Community Treasure Hunt

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

Start Hunting!

Translated by