count the number of new listings and delistings across time
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Qian cao
il 24 Dic 2015
Modificato: Walter Roberson
il 29 Dic 2015
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 Commenti
Risposta accettata
Azzi Abdelmalek
il 24 Dic 2015
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Financial Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!