필터 지우기
필터 지우기

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