Hello , i have two datasets with stocks , a large one that contains all the stocks at my disposal (and also has their monthly returns) and a smaller one which contains few of the stocks of the large one. I want to take those few stocks from the large set along with their returns. I have tried newset=largeset(largeset.Stock==smallset.Stock,{'Stock','July'}) to get the stocks along with their July returns but i get the : Undefined function or method 'eq' for input arguments of type 'cell' error. Any help would be appreciated.

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 7월 10일

0 개 추천

LargeStock={'a',0.1;'b',0.2;'c',0.3;'d',0.4;'e',0.5};
MyStock={'b','d'};
Index=ismember(LargeStock(:,1),MyStock);
MyStockAndReturn=LargeStock(Index,:);

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by