subscipted assignment dimension mismatch

1 次查看(过去 30 天)
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 个评论
Walter Roberson
Walter Roberson 2015-11-25
Which line does the error occur on? Please include the complete error message, everything in red.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by