Effacer les filtres
Effacer les filtres

Simulink: how to define variable that will remain constant during duration of simulation and use in MATLAB function blocks

3 vues (au cours des 30 derniers jours)
I am trying to run a custom recursive least squares block and want to be able to configure the filter order N from a config file.
The value of the filter order will remain constant for the entire simulation. How can I create functions that:
a) produce a vector of N past values to act as the regressor
b) fit the parameters to the data
Currently simulink is giving errors because the vector of regressors and parameters are of variable size, (which is not true within any single simulation run). How can I get around this issue without having to go through a large number of blocks and set up all these signals as variable sized?

Réponse acceptée

Paul
Paul le 15 Mai 2023
For part a), a Tapped Delay block seems like it meets the need.
For part b), in the absence of any other information, feed the oiutput fo the Tapped Delay block into a Matlab Function to do the fitting.

Plus de réponses (0)

Catégories

En savoir plus sur Linear Model Identification dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by