create vector with no repeated triplet sequences based on another vector

1 次查看(过去 30 天)
Hi,
I have a vector A=[1,2,3,4,5,6].
If we split this vector into triplets, with moving window of 1, we get these triplets: 123,234,345,456.
What I would like to do is create another vector B, using the exact same numbers that is in A. But I need to make sure that the triplet sequences in B are not present in A. So something like B=[6,2,5,4,3,1] because the triplets we get are: 625,254,543,431 which are not present in vector A.
Thanks!

回答(1 个)

Thorsten
Thorsten 2016-8-16
Just reverse order:
B = fliplr(A);
  5 个评论
Thorsten
Thorsten 2016-8-16
编辑:Thorsten 2016-8-16
You're right, then it would be possible. But I have no solution ready of how to achieve it.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by