MATLAB Answers

sorting a time series

14 views (last 30 days)
Fred
Fred on 11 Feb 2013
Hello,
II have a time series Yt and I sorted them in ascending order and I got Yi, then I used them in a function and I got Zi as Zi=F(Yi), How can I rearrange Zi to Zt (the same order of Yt)?

  0 Comments

Sign in to comment.

Accepted Answer

Conrad
Conrad on 11 Feb 2013
You need to use the optional output from the sort function that contains the sort order.
[Y, idx] = sort(time_series);
Zt = Zi(idx);

  0 Comments

Sign in to comment.

More Answers (1)

Youssef  Khmou
Youssef Khmou on 11 Feb 2013
hi, you apply directly the function Zt=F(Yt) as :
(Yt,Yi) =>: F(Yt,Yi)=(Zt,Zi)

  0 Comments

Sign in to comment.

Sign in to answer this question.

Tags

Products


Translated by