フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

different sample times of vectors

4 ビュー (過去 30 日間)
Owen
Owen 2012 年 11 月 22 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 23 日
Can you post your simulink model?
Owen
Owen 2012 年 11 月 25 日
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

回答 (0 件)

この質問は閉じられています。

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by