我有一个从测量文件中提取的序列,序列如下所示。查找递减序列的起始索引
a = [2 1 3 2 1 0 1 2 3 4 5 4 3 2 3 4 5 4];;
我要找到每个递减序列的开始索引.... 为例如:在上述序列中,你可以找到的顺序开始在以下指数
1. [3 2 1] this sequence starts decreasing from the index 3,
2. [5 4 3 2] this sequence starts decreasing from the index 11,
3. [5 4] this sequence starts decreasing from the index 17.
任何想法,就减少如何找到这个序列的起点会更加有用...在此先感谢
我试过使用函数,即 差异和findpattern(a,[4 3]).... 当我使用findpattern函数我不得不提及列表中的所有模式组合,并检查它...它不是一个可行的功能。我想知道在Matlab中是否有其他更简单的查找序列模式的方法 –
请发布您的代码... – Josh
您希望结果为[3 3 2 1]和[3 2 2] 2 1]'? –