count the number of new listings and delistings across time
1 回表示 (過去 30 日間)
古いコメントを表示
Dear there, Happy Christmas. Could you gift me by helping me to solve my problem:) haha.
I have the following price matrix, with rows for time from date 1 to date 7 and columns for 5 assets. The values available in each column means the asset is traded on the market. For asset 1, it is listed on date 4 and is delisted on date 6. Asset 2 is listed on date 1 and not listed. Asset 3 is listed on date 1 and listed on date 4...so on...I want to know to summarize how many assets are newly listed and how many are just right delisted from the market over time.The result is expected be two vectors,one is new=[2 0 1 1 0 1 0] and the other is new delisting=[0 0 0 1 0 1 0].
Thank you very much. I am waiting online for your answers.
p2 =
NaN 2 4 NaN NaN
NaN 1 1 NaN NaN
NaN 3 1 1 NaN
1 4 NaN 1 NaN
2 2 NaN 2 NaN
NaN 1 NaN 3 2
NaN 1 NaN 4 2
0 件のコメント
採用された回答
Azzi Abdelmalek
2015 年 12 月 24 日
p2 =[ NaN 2 4 NaN NaN
NaN 1 1 NaN NaN
NaN 3 1 1 NaN
1 4 NaN 1 NaN
2 2 NaN 2 NaN
NaN 1 NaN 3 2
NaN 1 NaN 4 2]
ii=~isnan(p2);
new=sum([ii(1,:) ;diff(ii)]==1,2)
new_delesting=sum([ii(1,:) ;diff(ii)]==-1,2)
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Financial Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!