Trouble understanding the Flip block in Simulink

조회 수: 2 (최근 30일)
Rafael Cordero
Rafael Cordero 2020년 6월 16일
댓글: Rafael Cordero 2020년 6월 17일
Hello world!
New to Simulink. Did a bunch of tutorials, now trying some projects.
I'm having some problems with the 'Flip' block of the DSP system toolbox. Lets say I have an input vector v where:
v = [0 1 0 1 0 0 0 1 1 0 1 1 1 2 1 2 2 2 1 2 1 3 3 2 1 1 2 3 2 3 3 2 3 3 3 2 2 2 1 0 0 0 -1 -1 -1 -2 -1 -1 -2 0 -1 0 -1 0 0 0]'; % Arbitrary real column vector
And its corresponding time vector t where:
t = (0:1:length(v)-1)'; % Time column vector
I then imported them into the following Simulink model via the data import/export tab in the model configuration parameters settings:
Me flip block is flipping along columns.
So I would have thought that the scope would show me the original signal v, and a left-to-right flipped version of the original signal. Instead I get that both are the exact same:
Questions: - Why is this happening?
- How would I get a left-right flipped version of the input signal?
I tried looking at the documentation but it didnt really help too much.
Bonus question: - All of this was because I want to implement filtfilt in Simulink but for some reason (as other people have asked) it doesn't work when you do it via a Matlab function call block. So if anyone has any pointers on that I'd be super grateful.
Thank you!
R

답변 (1개)

Jonas
Jonas 2020년 6월 17일
편집: Jonas 2020년 6월 17일
When you are importing a data vector in your Simulink model, it reads the data vector one by one, sample by sample and executes the Simulink model's operations on each sample separately. Simulink is a time-based or sample-based simulation tool. Your vector 'v' is not read in its interity.
This means that what is going in your 'flip' block is a single value. Flipping a single value results in the same value again.
  댓글 수: 1
Rafael Cordero
Rafael Cordero 2020년 6월 17일
Ahhh, I understand. Thank you. In that case, is it possible to send the entire vector 'v' to the flip block rather than sample by sample? I tried using the buffer block but wasnt succesfuly.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Signal Attributes and Indexing에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by