How can i create a column vector that sotres PERMNO for all that had positive ret and name this column vector as sample?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
PERMNO DateOfObservation prc ret Bid Ask shrout
______ _________________ _______ _________ _________ ______ _______
10026 20201231 155.37 0.072598 155.37 155.48 18954
10028 20201231 5.2 0.125541 5.21 5.25 26925
10032 20201231 78.21 0.046848 78.21 78.29 28823
10044 20201231 4.05 -0.051522 4.05 4.1 6071
10051 20201231 21.99 -0.030851 22.01 22.02 38109
10065 20201231 17.29 0.036571 17.29 17.3 108731
How can i create a column vector that sotres PERMNO for all that had positive ret and name this column vector as sample?
0 commentaires
Réponses (1)
Voss
le 20 Fév 2022
Modifié(e) : Voss
le 20 Fév 2022
% reproducing your table:
data = num2cell([ ...
10026 20201231 155.37 0.072598 155.37 155.48 18954
10028 20201231 5.2 0.125541 5.21 5.25 26925
10032 20201231 78.21 0.046848 78.21 78.29 28823
10044 20201231 4.05 -0.051522 4.05 4.1 6071
10051 20201231 21.99 -0.030851 22.01 22.02 38109
10065 20201231 17.29 0.036571 17.29 17.3 108731
],1);
t = table(data{:},'VariableNames',{'PERMNO' 'DateOfObservation' 'prc' 'ret' 'Bid' 'Ask' 'shrout'})
% getting PERMNO where ret > 0:
t{t{:,"ret"} > 0,"PERMNO"}
0 commentaires
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!