Index in position 2 exceeds array bounds (must not exceed 1).
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Please am working with the code below and the problem is am using the last column of the data for the mqp, want to know how i can select the last column so that i can loop 65 times across the tickers in the first coulmn of the data.
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
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!