How to store any simulink signal data in a 2 dimensional array?

6 visualizaciones (últimos 30 días)
Sunandan Adhikary
Sunandan Adhikary el 15 de Oct. de 2020
Editada: Sunandan Adhikary el 15 de Oct. de 2020
It is possible to sum the signal data cumulatively because the addition blocks support a recursive addtion, i.e. one can add last cumulatively summed result multiplied with a unit delay to the current signal data. But the same recursive loop is not possible if one tries to use mux to create the 2 dimensional vector. Even with a matlab function block simulink throws error of dimesion mismatch, when one tries to store the data iteratively using similar unit delay block. Tried buffer, does not work! Storing data to a memoy block needs declaration of signals beforehand that we want to store any array Is there any standard procedure? Please help, it is urgent and stuck for so long. Thanks in advance.
  2 comentarios
stozaki
stozaki el 15 de Oct. de 2020
Hello Sunandan,
Do you want to cumulatively add vector signals? Modeling like attachments does not cause any errors. Is this model effective for you? If you will use this model I will be able to attach a .slx file.
stozaki
Sunandan Adhikary
Sunandan Adhikary el 15 de Oct. de 2020
Editada: Sunandan Adhikary el 15 de Oct. de 2020
Thanks @stozaki, but no. Actually I am able to add, because addition block supports such loops. But not able to store them in a vector or 2 dimesional array. Tried to use a mux, but it throws error that it doesn't support such loops. if at k=1 r=2, k=2 r=-4, k=3 r=10 and so on for k=10 let's say then what I want is to output an array in every iteration i.e.at k=3 r_array=[2,-4, 10] to understand the distribution. Is there any standarad procedure for that? (k is sampling instance, r_array is an array of variable values r over consecutive instances, that we can access within workspace)

Iniciar sesión para comentar.

Respuestas (0)

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by