subscipted assignment dimension mismatch

Dear all;
I have 2 time series, two columns (attached). and just trying to use the code (attached) for the ADCC (mutlivariate) model as written by Kevin Sheppard.
Instead of calling the function direclty. I just copy and past step by step to understand what is going on. I definded the inputs as follows:
data = time series attached
(imported from my desktop) then converted to A T by K matrix of zero mean residuals by
[T,k] = size(data);
data2d = data;
eta = data.*(data<0);
data = zeros(k,k,T);
dataAsym = [];
m=1;
l=1;
n=1;
p=1;
o =0;
q=1;
gjrType = [];
method = 'diagonal;
composite = [];
startingVals = [];
options = [];
once I copy and paste the first part of the code:
if ndims(data)==2
[T,k] = size(data);
data2d = data;
eta = data.*(data<0);
data = zeros(k,k,T);
dataAsym = zeros(k,k,T);
for t=1:T
data(:,:,t) = data2d(t,:)'*data2d(t,:);
dataAsym(:,:,t) = eta(t,:)'*eta(t,:);
end
elseif ndims(data)==3
[k,~,T]=size(data);
data2d = zeros(k,k,T);
for i=1:k
data2d(:,i) = squeeze((1-2*(dataAsym(i,i,:)==0)) .* sqrt(data(i,i,:)));
end
else
error('DATA must be either a K by T matrix of a K by K by T 3-dimensional array.')
end
if ~isempty(dataAsym)
if ndims(dataAsym)~=3
error('DATAASYM must be a K by K by T array.')
end
[k1,k2,T2] = size(dataAsym);
if k1~=k || k2~=k || T2~=T
error('DATAASYM must be a K by K by T array.')
end
end
I got the following the error message: Subscripted assignemnt dimension mismatch"
I am using MATLAB 2013a.
please see attached data and code and advice.

댓글 수: 1

Which line does the error occur on? Please include the complete error message, everything in red.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

질문:

2015년 11월 25일

댓글:

2015년 11월 25일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by