I have 6 cross-sectional time series arrays with varying dates and about 99 assets. I want to create a new array with only common dates from all the six arrays. I tried using the following function which uses "ismember" which works well for 2 arrays, but i am unable to generalize it for n arrays.
idx = ismember(indexchg(:,1),equitychg (:,1))
finalmatrix = [indexchg(idx,1) indexchg(idx,2) equitychg(idx,2:end)]
Can someone suggest a way to generalize this. I am trying to use find function in Matlab to find asset and dates but that i guess will have to run a host of loops to arrange the data. Can anyone suggest an easier way
merge(indexchg, equitychg , otherchgs, .... ,'DateSetMethod','Intersection')idxis indexingindexchgbut you also pass it toequitychgin last line, doesn't seem right.