Info

此问题已关闭。 请重新打开它进行编辑或回答。

Order in combined financial time series

1 次查看(过去 30 天)
Dominik
Dominik 2013-4-8
关闭: MATLAB Answer Bot 2021-8-20
Hello,
I have the following problem:
I create a fts for each security and simply name it s1,s2,...,s30 just by the index k of the loop.
for k=1:z
prices_fts{1,k}=fints(prices_sort{1,k}(:,1),prices_sort{1,k}(:,2),['s' num2str(k)]);
end
So far so good.
Now I merge all fts to one.
all_fts=prices_fts{1,1};
for k=1:z
all_fts=merge(all_fts, prices_fts{1,k});
end
Here comes the problem: instead of sorting it straight from 1 to 30, the order of the single series in the merged series is 1,11,12,13,14,15,16,17,18,19,20,21,...,3,30,31. It's all sorted by the first number.
I didn't find anything about sorting it rigth. I am thankful if somebody can help me.
Dominik

回答(1 个)

Leah
Leah 2013-4-8
I don't have the financial toolbox, so it's hard to know exactly what's going on. You can use orderfields and specify an array with the order you want.
It might work to merge all at once instead of in a loop, but it seems like the sort is happening inside merge.

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by