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)
data: [5 3 1 -1 3 -2 2 3]
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);
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.