Simulink variable signal size
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to implement a logic, were i would have a variable signal size data with me.
Whenver the simulink model is executed then the there would be new set of data received, this data either needs to be updated in the existing values in the variable size signal or needs to be appended to the existing variable signal size.
I am not sure quick how to acheive this, i tried using the below pattern, where newData is getting appended to the prevData, but it does not work, as to get the previous data i am using a delay block, which gives me error as the size of the delay block cannot be propogated. Here i am just appending the data without any condition, but ofcourse in the real world i would make sure that the DataOfInterest is having max bound of some number and not take newData later.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1145955/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1145960/image.png)
0 commentaires
Réponses (1)
Benjamin Thompson
le 5 Oct 2022
You cannot change the size of signals during a simulation run. That is what your MATLAB function is doing, trying to add new data on each function call.
1 commentaire
Voir également
Catégories
En savoir plus sur Sources dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!