Hi,
I would like to implement a particle filter in Simulink. Therefor it is necessary to get random numbers (up to 10000 per cycle) for sampling particles.
In Matlab you can find the randn(10000,1) function and everything works fine. Now I switched to Simulink. I use the embedded M Files, but I always receive failures when using randn in the Embedded M File. Simulink has a "Random number" block. Instead of a scalar you can input a vector ones(10000,1) as "mean" parameter. The output is a vector(10000,1) of one (always the same) random number.
Has anybody an idea how to get a vecotr of 10000 different random numbers in Simulink equivalent to the randn function in Matlab?
Thank you very much for you help.
Greetings.

回答 (2 件)

Fangjun Jiang
Fangjun Jiang 2011 年 5 月 26 日

0 投票

Change the "Seed" property of the "Random number" block to 1:10000 so each series of random number is different.

1 件のコメント

Fangjun Jiang
Fangjun Jiang 2011 年 5 月 26 日
Not sure if this is your intention. Do you want 10000 random numbers at once, or do you want one random number at a time, for 10000 time steps?

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

Markus
Markus 2011 年 5 月 27 日

0 投票

Yes, I would like to have 10000 random numbers at once and your advice works fine! Thank you very much!

1 件のコメント

MAYANK JHA
MAYANK JHA 2015 年 3 月 25 日
hello Markus, were you able to design a particle filter in simulink?....can i please have your model for my help??....i will be so much thankful. please write to me on : jha.mayank.jha@gmail.com cheers.. mayank

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

カテゴリ

質問済み:

2011 年 5 月 26 日

コメント済み:

2015 年 3 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by