MATLAB Answers

0

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

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 件のコメント

サインイン to comment.

0 件の回答


Translated by