Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Help on creating a comma-separated list of financial time series objects
조회 수: 1 (최근 30일)
이전 댓글 표시
I'm trying to create a list of comma-separated financial time series objects (fints), in order to pass it to the financial toolbox function merge(). I currently have a 500x1 cell array, where each cell contains one fints. Now I'd like to merge the closing prices (of each fints) into a final fints while keeping only the data points whose dates intersect. I've tried numerous ways to do that, but in the end all of them resulted in errors which said that somehing's wrong with the comma-separated list. This is my latest (ugly and non-working) attempt:
for i = 1:length(cellarray),
list{i} = strcat('cellarray{',num2str(i),'}.Close');
end
finalFints = merge(list{:},'DateSetMethod','Intersection');
Any help would be greatly appreciated...
댓글 수: 0
답변 (1개)
Walter Roberson
2013년 12월 14일
T = {cellarray.Close};
finalFints = merge(T{:}, 'DataSetMethod', 'Intersection');
You might need
T = cellfun( @(F) F.close, cellarray, 'Uniform', 0);
finalFints = merge(T{:}, 'DataSetMethod', 'Intersection');
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!