How to split signal in simulink?
82 ビュー (過去 30 日間)
表示 古いコメント
Hello, I have this easy model. In matlab function block I have command ulength=length(u); and it returns me 1. It should give me 30, because in red box is set time to 30. My question is if I can split somehow the signal, because I need to use in matlab function block for loop: For example:
for k=1:30
z= [-y(k-1) u(k-1)]';
end
But it shows me error: that signal 'u' and 'y' are one dimensional with one element. So is there way how to split that signal so I could work with it like in matlab workspace?

採用された回答
Jim Riggs
2018 年 3 月 20 日
編集済み: Jim Riggs
2018 年 3 月 20 日
I'm not sure if this is the answer to your question, but Here is how to access a signal from the previous calculation iteration, y(n-1), in Simulink:

2 件のコメント
Jim Riggs
2018 年 3 月 21 日
Very good.
The memory block may be set to any delay you desire.
n-1, n-2, n-3, .... etc.
you specify the delay inside the block. Default is 1.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!