"Subscripted assignment dimension mismatch"?

3 ビュー (過去 30 日間)
Akhila
Akhila 2015 年 2 月 18 日
コメント済み: Akhila 2015 年 2 月 19 日
I'm unable to figure out where this error is coming about in this block of code. Any help would be great. Thank you.
%%Write data to a file (requires writeM2T.m)
cnt=0;
cnt2=0;
ind = [1 2 3 4 5 -win:win];
for i=1:length(Ndya)
for j=1:Nepi
if ~isempty(data(i,j).MOM)
if ~isempty(data(i,j).BABY)
cnt=cnt+1;
OUTcrqa(cnt,:) = [i j data(i,j).crqa];
OUTlagp(cnt,:) = [i j data(i,j).crqaBS];
for k = 1:max(size(data(i,j).crqaCI))
cnt2=cnt2+1;
OUTcrqaCI(cnt2,:) = [i j data(i,j).crqaCI(k,:) ind(k)];
end
end
end
end
end
cd(yourpath)
save('CRQAoutput.mat')
hdr1={'dyad','episode','RR','DET','<L>','Lmax','ENTR','LAM','TT','Vmax','T1','T2','RTE','Clust','Trans'};
writeM2T(OUTcrqa,'outCRQA.dat',hdr1,[],[],'w')
%hdr2=[{'dyad','episode'} {num2cell(-win:win)}];
writeM2T(OUTlagp,'outLAGPcrqad.dat',[],[],[],'w')
% Bootstrapped CI
hdr3={'dyad','episode','CI_U','CI_L','Measure'};
writeM2T(OUTcrqaCI,'outBSCI.dat',hdr3,[],[],'w')
  8 件のコメント
Erik S.
Erik S. 2015 年 2 月 18 日
I cannot run this... there are files missing for me... Can you send all I need to run the hole thing!
Akhila
Akhila 2015 年 2 月 18 日
Hi Erik, Attached is the whole folder. The .m file has the MATLAB code.

サインインしてコメントする。

回答 (2 件)

Erik S.
Erik S. 2015 年 2 月 18 日
Your sturcture data only contains the fields "dyad" and "episode" not "MOM" or "BABY"
When you get to line 67 the program crashes.
  1 件のコメント
Akhila
Akhila 2015 年 2 月 18 日
aah, but won't the declarations in line 38, 39, 42, 43 suffice?

サインインしてコメントする。


Erik S.
Erik S. 2015 年 2 月 18 日
Those lines 38-43 are never executed. The files you are looking for is in another folder than you .m file. Try to move them to the same folder.
  8 件のコメント
Erik S.
Erik S. 2015 年 2 月 19 日
編集済み: Erik S. 2015 年 2 月 19 日
The exceptions occurs because the function pss is undefined for arguments of type double it says. Is pss a function or a variable?
The error is:
Reference to non-existent field 'crqa'.
Error in TS16WCode (line 154) OUTcrqa(cnt,:) = [i j data(i,j).crqa];
Akhila
Akhila 2015 年 2 月 19 日
i'm not getting those exceptions, so not sure what you are asking. I'm going to try some other things. Thank you for your help. I will be in touch if I can clarify the question further.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeANOVA についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by