title: Matlab/Simulink SimState error
body: <p>i'm working with Simulink (Matlab) and I have a problem: 
  I start a simulation and every 'T' time I need to stop it, save the state of the system as Simstate, and then restore the system state by changing a few variables. For example, I am working with the base model 'Inverted Pendulum with Animation' (penddemo.mdl), and when I restore the state I must change the mass of the pendulum, here's some code:</p>
  
  <pre><code>set_param('penddemo','LoadInitialState','on','InitialState','init_state'); % load the initial state
  set_param('penddemo','SaveFinalState','on','FinalStateName', 'xFinal','SaveCompleteFinalSimState', 'on'); % save the complete simstate
  set_param('penddemo/Pendulum','Mcart','0.600'); % change the mass
  sim('penddemo',time); %starting the simulation
  </code></pre>
  
  <p>The problem is that I get this error: </p>
  
  <p><em>can not load the Simulink SimState Because The initial model, 'penddemo', was changed after the SimState was saved. Run the simulation again and resave the SimState.</em></p>
  
  <p>I know that there are limitations in the use of Simstate: </p>
  
  <p><em>You cannot make any structural changes to the model between the time at which you save the SimState and the time at which you restore the simulation using the SimState. For example, you cannot add or remove a block after saving the SimState without repeating the simulation and saving the new SimState.</em></p>
  
  <p>but I do not think changing a single variable is a structural change.
  Maybe someone knows another way to change some variables before the recovery of Simstate. </p>
  
  <p>Thanks all</p>