SIMULINK - Save the different states of a variable in a vector
4 次查看(过去 30 天)
显示 更早的评论
Hello everybody,
I have a variable x that has its value changed every simulation step. What I would like to do is saving each value that x takes in a vector State.
State = [x1 x2 x3 ... xn] with x1, x2, x3, ... xn the values of x at the first, second, third...nth simulation step.
Is it possible ? Is there a block that can do that or do I have to create my own function ?
Thank you very much for your help.
0 个评论
采纳的回答
goerk
2018-7-6
There are multiple solutions for this, dependent on what you want to do with the data.
To save the data to the workspace you can use the'To Workspace' block.
To use the last n values in your model you can for example use the 'Tapped Delay' block.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!