找到双序列以变换在Matlab? [英] To Find Double Sequence With Transforms in Matlab?
问题描述
欲查找双序列(的10位数据,这里没有必要),其长度大于2。
某些元素的双序列可以通过两个指标进行编号,这里。
示例数据
数据= 4.123456 4.123456 4.123456 4.123456 7.123456 1.123456 1.123456 1.123456]
这预期成果是
{[4.123456 4.123456 4.123456 4.123456],[1.123456 1.123456 1.123456]}
汉克尔方法
我感兴趣的是像汉克尔
转换为在这里的回答用得好了解的在数组中找到4个值的序列不循环的和描述的由J.莱曼这里好。汉克尔提供了一个序列的变换及其矩阵的行列式的 Catalecticant 的,后者属性是一个可以用在这里。其可以表征双序列的两个指数。
这里的问题是,是否可以表征给定的序列或没有的汉克尔决定因素。我认为这是不可能的。
不完整的伪code
- 变换
数据
成方阵,用两个指数来恩preSS双打。 - 循环的第一个索引。
- 循环第二个索引。
- 设置
计数
如果两个向量(第一和第二索引)是相同的。 - 重置
计数
如果第三矢量预计不会为previous两项。 - 返回到(1)。
- 结束在数据结束。
- 设置
您如何找到在数据双序列?
我对这个问题的解决方案,假设我理解正确的话:
X = [9 1 5 6 6 6 5 1 1 0 7 7 7 7 7 8]。D =差异(差异([0 X 0])== 0);
Y = arrayfun(@(I,J)×(I:j)中,发现(d取代; 0),找到(四℃,),'统一',假);
celldisp(Y)
这个例子的结果是:
X =
9 1 5 6 6 6 5 1 1 0 7 7 7 7 7 8Y =
[1×3双] [1x2的双重] [1X5双]
Ÿ{1} =
6 6 6
Ÿ{2} =
1 1
Ÿ{3} =
7 7 7 7 7
I want to find double sequences (of 10-bit data, not necessary here) which length is more than 2. The double sequence of certain elements can be numbered by two indices, here. Example data is
data = [ 4.123456 4.123456 4.123456 4.123456 7.123456 1.123456 1.123456 1.123456 ]
which expected output is
{[4.123456 4.123456 4.123456 4.123456], [1.123456 1.123456 1.123456]}
Hankel approach
I am interested in transformations like hankel
as used well in the answer here about Finding a sequence of 4 values in an array without loop and described here by J. Layman well. Hankel provides a transformation of a sequence and the determinant of its matrix is Catalecticant, where the latter property is the one that can be useful here. It may characterise the two indices of the double sequence.
The problem here is that whether we can characterise Hankel determinants of the given sequences or not. I think it may not be possible.
Incomplete Pseudocode
- Transform
data
into square matrix and use two indices to express doubles. - Loop the first index.
- Loop the second index.
- Set
counter
if two vectors (1st and 2nd indexes) are the same. - Reset
counter
if the third vector is not expected as the previous two. - Go back to (1).
- End at end of data.
- Set
How can you find double Sequence in the data?
My solution of the problem, assuming I understood it correctly:
x = [9 1 5 6 6 6 5 1 1 0 7 7 7 7 7 8];
d = diff(diff([0 x 0]) == 0);
y = arrayfun(@(i,j) x(i:j), find(d>0), find(d<0), 'Uniform',false);
celldisp(y)
The result for this example:
x =
9 1 5 6 6 6 5 1 1 0 7 7 7 7 7 8
y =
[1x3 double] [1x2 double] [1x5 double]
y{1} =
6 6 6
y{2} =
1 1
y{3} =
7 7 7 7 7
这篇关于找到双序列以变换在Matlab?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!