gpsSensor problem with Random Stream

조회 수: 2(최근 30일)
Leonardo Costa
Leonardo Costa 2021년 4월 28일
댓글: Leonardo Costa 2021년 4월 29일
Hi to everybody!
I have a big problem with my gpsSensor. In my model I need to use 2 gps: one for my boat and one for my buoy (target).
The two GPS shares the same characteristics but I expected to have two different random stream. I saw on the decumentation that the deafult RandomStream is Global Stream and it's ok for my sensors, but i would like to have two different random stream for my GPS.
Hope that I weel explained my problem.
Thank you in advance!!!

채택된 답변

Ryan Salvo
Ryan Salvo 2021년 4월 28일
Hi Leonardo,
To set two gpsSensor objects to two independent random streams, you can set the RandomStream and Seed properties on the gpsSensor.
% Set each of the seeds to different values.
seed1 = 20;
seed2 = 40;
gps1 = gpsSensor("RandomStream", "mt19937ar with seed", "Seed", seed1);
gps2 = gpsSensor("RandomStream", "mt19937ar with seed", "Seed", seed2);
  댓글 수: 5
Leonardo Costa
Leonardo Costa 2021년 4월 29일
Thank you very much!!!

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by