MATLAB: Can’t save Simulink simulation results after changing parameter

MATLABparametersimulinkvariation

Hey everybody,
so I have a Simulink simulation where I vary a parameter
for i=1:length(parameter)
Input_var=parameter(i)
sim(modelname)
simout_store(:,i)=simout(:,1) %simout is a "to workbench" output in the simulation
end
But all I get is this error "Subscripted assignment dimension mismatch." How can I fix this? I just want to save the results after every simulation before it gets overridden

Best Answer

Use a cell array
simout_store{i}=simout(:,1)