gpsSensor problem with Random Stream

C
Costa · Sep 30, 2021 · 1.9K views
Question
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.
Expert Answer
Profile picture of John Michell
John Michell PhD Expert
Answered Nov 20, 2025
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);
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!