The code below gives me "Index in position 2 exceeds array bounds (must not exceed 1)." when ever i run.
Info
This question is closed. Reopen it to edit or answer.
Show older comments
load Trade
load Midquote
data1=AustriaTrade;
data2=AustriaMquotes;
%{mdq trade ask bid spread volume No_trades};
%data5 = SpainTrade;
mqp= log(data2(:,6));
mqpd = mqp-repmat(mean(mqp,1),length(mqp),1); % demaen data
mqpd= mqpd(:,1:end);
trade= log(data1(:,4));
traded = trade-repmat(mean(trade,1),length(trade),1); % demaen data
traded= traded(:,1:end);
%mqp= (dataalldaily{1,1}); traded(:,266:end)traded=[traded(:,1:264) traded(:,266:end)];
%trade= (dataalldaily{1,2});
%%% Ask and Bid
ask= log(data2(:,5));
ask = ask - repmat(mean(ask,1),length(ask),1); % demaen data
ask= ask(:,1:end);
bid= log(data2(:,4));
bid = bid - repmat(mean(bid,1),length(bid),1); % demaen data
bid= bid(:,1:end);
%end
naset=2;
lag = 10;
rank = 1;
%implag = 50;
ndays = 261;
nstock = 65;
ILST1 = zeros(ndays,nstock);
ILST2 = zeros(ndays,nstock);
ACF=zeros(ndays,nstock);
VOL=zeros(ndays,nstock);
for k=1:ndays-1
for j=1:nstock
data=[mqpd((k-1)*72+1:k*72,j) traded((k-1)*72+1:k*72,j)];% 2 variables
end
end
1 Comment
KSSV
on 16 Sep 2020
The error clearly says, you are trying to access more number of elements then present in an array.
By the way you have not specified the line where error is present.
Answers (1)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!