- Number of input signals = 1
- Selector Mode = 'Fixed'
- Elements = [1] (2 if you want to extract the second row from the output X)
Simulink state space system with close loop
4 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I need help to solve a problem.
I'm building a simulink system. I have an 'interpreted function' block where at the input there are values that I take from the work space of the main matlab, and in output it gives me a 1-D signal which is then input into the state space block. The state space block sends me two values, since my initial state is a 2x10 vector. Seeing with scope the graph gives me two signals that are row 1 and row 2 of my updated vector. How do I take one of the two lines of the state space block output, then insert it together with the initial inputs in the 'function interpreted' block and do a close loop?
0 个评论
回答(1 个)
Pranjal Kaura
2021-8-31
Hey,
It is my understanding that you want to extract a subset (a single row in your case) from the output of the state space block. You further want to pass this extracted vector into the 'function interpreted' block.
Variable Selector block can be used to extract a subset from the output of the state space block (say X). Since the shape of output 'X' is known, you can set the following parameters in the Variable selector block:
This extracted signal can then be concatenated to your inital inputs of the 'function interpreted' block using the Vector/Matrix concatenate block. You can further slice this input as per your requirement in the MATLAB function created for the 'function interpreted' 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!