How can i create a column vector that sotres PERMNO for all that had positive ret and name this column vector as sample?
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
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 comentarios
Respuestas (1)
  Voss
      
      
 el 20 de Feb. de 2022
        
      Editada: Voss
      
      
 el 20 de Feb. de 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 comentarios
Ver también
Categorías
				Más información sobre Startup and Shutdown en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

