Don't understand sequences or how to process them in a function.

조회 수: 1 (최근 30일)
Christopher Piland
Christopher Piland 2019년 7월 10일
I don't understand sequences that contain offsets. Furthermore I don't understand how to process them in a function. Ive exauseted all the help the matlab directory can give me and this is my last resort. The code looks like this.
y = sequence([5 3 1 -1 3 -2 2 3], -1)
y=
data: [5 3 1 -1 3 -2 2 3]
offset: -1
That is the input and the ecoed output of y.
I want to flip sequence y using flipr comand but it dosent work.
this is the code I am using is:
function y = flip(x)
y.data = fliplr(x.data);
y.offset = -((x.offset + length(x.data))-1);
y= sequence([y.data], y.offset);
end
When the code exicutes the program hangs, gives no errors, and then asks for anuther input as if nothing happened. I don't understand what is going on and I don't understand how to fix it.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by