フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to detect a numerical pattern?

1 回表示 (過去 30 日間)
Damo Nair
Damo Nair 2017 年 2 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi,
I have a data set that has 2 columns, states & prices. Like this ...
prices = [-1.5 -1.2 -2 -2.4 -1.3 -0.2 -0.6 -0.6 0.8 1.8 2.4 2 1.9 1.88 3 3.7 4.2 4.1
4.5 3.3 3.5 2.6 1.5 1.4 1.7 1.6 2.4 2.9 3.4 3.3 3.8 2.9 2 1.8 1.5];
states = [1 2 1 1 2 2 2 2 2 4 4 4 3 2 4 4 4 4 4 4 4 2 2 2 2 2 4 4 4 4 4 2 2 2 2];
Now, after the last lowest state, i.e. 1 the prices move up, move down, go back up etc.
My question how can I detect these up & down moves with respect to state 1?
Right now I'm using really cumbersome commands like
f1 = find(t1(:,2) == 1, 1, 'last') &
fm = find(t1(:,1) == max(t1(:,1)) & t1(:,1) > f1) & run length on price difference.
And am not getting anywhere. Any easier, quicker way to detect these up & down moves?
Thanks
Damo.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by