How can i create a column vector that sotres PERMNO for all that had positive ret and name this column vector as sample?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Voss
il 20 Feb 2022
Modificato: Voss
il 20 Feb 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 Commenti
Vedere anche
Categorie
Scopri di più su Startup and Shutdown 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!