Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How to detect a numerical pattern?

1 vue (au cours des 30 derniers jours)
Damo Nair
Damo Nair le 4 Fév 2017
Clôturé : MATLAB Answer Bot le 20 Août 2021
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.

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by