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

1 view (last 30 days)
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.

Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!