Hi Alec,
You can use the setVariable method on the SimulationInput object to specify a new value for the variable
Here is your modified script (I have also reduced number of simulations to 10 so that you can pause in the set_values function and see the scope change)
mdl = 'my_model';
N = 10;
sim_in(1:N) = Simulink.SimulationInput(mdl);
for i = 1:N
sim_in(i) = sim_in(i).setPreSimFcn(@(x) set_values(x, i));
end
out_data = sim(sim_in);
function sim_in = set_values(sim_in, t)
simin.time = [0 t t+1 t+2];
simin.signals.values = [0 0 1 0]';
sim_in = sim_in.setVariable('simin', simin);
end
Please try it out and let me know if you have any more questions.
-- Rahul