R = readtable("Backtesting/OIH.xlsx");
tday1 = R{1:end, 1};
tday1.Format = 'yyyy-MMM-dd';
adjcls1=R(:,end);
T = readtable("Backtesting/RKH.xls");
tday2 = T{1:end, 1};
tday2.Format = 'yyyy-MMM-dd';
adjcls2=T(:,end);
H = readtable("Backtesting/RTH.xlsx");
tday3 = T{1:end, 1};
tday3.Format = 'yyyy-MMM-dd';
adjcls3=H(:,end);
tday=union(tday1, tday2);
tday=union(tday, tday3);
adjcls=NaN(length(tday), 3);
[foo idx1 idx]=intersect(tday1, tday);
adjcls(idx, 1)=adjcls1{idx1, 1}
[foo idx2 idx]=intersect(tday2, tday);
adjcls(idx, 2)=adjcls2{idx2, 1};
[foo idx3 idx]=intersect(tday3, tday);
adjcls(idx, 3)=adjcls3{idx3, end};
4 Comments
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/649788-row-index-exceeds-table-dimensions#comment_1138198
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/649788-row-index-exceeds-table-dimensions#comment_1138198
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/649788-row-index-exceeds-table-dimensions#comment_1139258
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/649788-row-index-exceeds-table-dimensions#comment_1139258
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/649788-row-index-exceeds-table-dimensions#comment_1145228
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/649788-row-index-exceeds-table-dimensions#comment_1145228
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/649788-row-index-exceeds-table-dimensions#comment_1145358
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/649788-row-index-exceeds-table-dimensions#comment_1145358
Sign in to comment.