フィルターのクリア

two column matrix concatetate

1 回表示 (過去 30 日間)
Owen
Owen 2012 年 8 月 30 日
Hi,
I want to combine two column matrix together with ‘Matrix Concatenate’. The inputs are 12x1 matrix from “Random Integer Generator” and 4x1 matrix from “Constant”: [1;2;3;4]. The “Random Integer Generator” is configured as frame based, M-ary number = 255, Initial seed = 37, Sample time = 1e-6, Sample per frame = 12.
In simulation I get such output: [137 49 17 101 168 232 138 251 143 53 248 82 1 2 3 4 137 49 17 101 168 232 138 251 143 53 248 82 1 2 3 4 …]
That is, the random matrix repeats several times which should not be. I think the reason is “Matrix Concatenate” uses old matrix between each generated frames. My question is, how to solve this problem cleverly.
Thank you very much Senmeis
  1 件のコメント
Matt Kindig
Matt Kindig 2012 年 8 月 30 日
Hi Owen,
It is a bit unclear what you are trying to do. Can you show us what your 12x1 matrix and your desired output look like?
Matt

サインインしてコメントする。

採用された回答

Ryan G
Ryan G 2012 年 8 月 30 日
編集済み: Randy Souza 2012 年 9 月 7 日
I think I see the issue.
You are seeing the same random values for 12 frames. This is because you setup the 12 samples/frame. This means you defined the frame as 12*e-6 seconds and it will not update until the frame finishes.
There are 2 ways to accomplish what you want:
  1. Set the sample time to 1e-6/12,or
  2. Concatinate 12 blocks (not frame based) at 1e-6

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by