我有一個從測量文件中提取的序列,序列如下所示。查找遞減序列的起始索引
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]'? –