Every time I run the program my PLOT in MATLAB gets changed to some extent (some times to larger extent too).

I understood that the channel is random and this might happen due to random distributions used to model the channel. Is there any way to solve this issue, so that every time I get the same values and plot.

  • $\begingroup$ You have to average over a certain number of channel realizations $\endgroup$ Jun 6, 2020 at 11:15
  • $\begingroup$ I am not sure about how we can answer here. You can stack the plots, to get a cumulative vision of how things change; but I don't know yet why it could be disturbing $\endgroup$ Jun 6, 2020 at 11:53
  • $\begingroup$ @ Laurent , it is disturbing because some time Bit error rate curve goes below and some time it goes above. $\endgroup$
    – charu
    Jun 6, 2020 at 12:05
  • $\begingroup$ @ Dsp guy, can you give simple example. $\endgroup$
    – charu
    Jun 6, 2020 at 12:06
  • 2
    $\begingroup$ Are you trying to run models with the same sequence of random numbers so it becomes repeatable? If yes, use $rng()$ to control the seed of the random number generator $\endgroup$
    – Hilmar
    Jun 6, 2020 at 13:41

1 Answer 1


The plots are changing i.e. you are changing inputs to the model (be it random input sequence , random channel matrix , random gaussian noise ) .. there are lot of random combinations here.. which will definitely change the plot.. you cannot expect to have same plot everytime when you are dealing with random numbers.. You can control with using same seed in random number generator.

  • Use the same seed while dealing with random numbers

Quick google search on this gave me this which you can use


  • $\begingroup$ ,ok understood the method in the link. $\endgroup$
    – charu
    Jul 27, 2020 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.