Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

different sample times of vectors

4 visualizaciones (últimos 30 días)
Owen
Owen el 22 de Nov. de 2012
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hi,
A data stream with a constant sample time 'ts' shall be converted to vectors of 2 different lengths (2 and 4) with the Buffer block. Example:
Data stream = … 1 2 3 4 5 6 7 8 9 10 11 12 …
Vector1 = … [1 2], [7 8], …
Vector2 = … [3 4 5 6], [9 10 11 12], ...
These 2 vectors must be combined with a constant from the Constant block with the Matrix Concatenate block.
For vector1: constant = [100 100]
For vector2: constant = [200 200]
So the result shall be:
End vector1 = … [100 100 1 2], [100 100 7 8], …
End vector2 = … [200 200 3 4 5 6], [200 200 9 10 11 12], …
The transmitted sequence shall be: … end vector1, end vector2, end vector1, end vector2 …
The problem is, there are 2 different sample times after the Buffer block: 2*ts and 4*ts. It seems very difficult to synchronize with this constant.
I tried to set the sample time of the Constant block as 2*ts and 4*ts with an Embedded Matlab Function at different time points but it doesn’t work (the output is only with length of 2 or length of 4 but not mixed as expected).
Can anyone show me a way?
Thanks Senmeis
  2 comentarios
Azzi Abdelmalek
Azzi Abdelmalek el 23 de Nov. de 2012
Can you post your simulink model?
Owen
Owen el 25 de Nov. de 2012
I’m sorry but it's not allowed to copy something from the computer in which Matlab is installed.
I think maybe I should do the procession in S functions or Embedded Matlab Functions. Sometimes I feel Simulink is only suitable for easy tasks. But thank you anyway.
Senmeis

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by