Hi Devyani, you can achieve this in two very simple ways:
- You can set the value of the "Seed" parameter in the block dialog to be “randi(5)”. This function returns a pseudorandom scalar integer between 1 to "imax", here "imax" is 5. This way each time the model is simulated, the seed value will be initialized to a random integer. Note that I have used the “randi()” function as an example, you may explore other available function as per your requirement.
- Another option is to use a variable in the base or model workspace as the seed value and then update its value by adding a “StartFcn” callback on the given block. This callback function will execute at the start of every simulation, so you again get a random value for each simulation.
