How to edit vales of saved state from simulink?

I have a simulink model that saves the final state to the workspace using the "save entire simstate" option so that I can run the model again starting from that saved state. I need to save the entire state, not just the values. How can I edit the values of the saved states in this structured variable?
Entering this in the command line will show the values of the saved states:
>>xFinal.loggedStates.values
However, if I try to edit those values like this I get an error:
>>xFinal.loggedStates.values(1)=5
??? Scalar structure required for this assignment.
I have also tried this approach with no result:
>>setBlockSimState(xFinal,'xFinal.loggedStates.values',5)
How do I edit the values in this variable????

3 Comments

What does xFinal.loggedStates.values return?
EDU>> xFinal.loggedStates.values
ans =
-24.4512
ans =
-13.8075
ans =
68.2572
ans =
2.1964
0
0
This command does not return an error, but it does not change the value of the state:
>>setBlockSimState(xFinal,'Three_TF_updatingstates_withcontrol2/Transfer_Fcn',5)

Sign in to comment.

Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Products

Asked:

on 27 Feb 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!