Error-Reference to non-existent field

1 次查看(过去 30 天)
I get an error when executing the code
clc;
clear;
a2=load('DisA.mat')
b2=load('Distance_text1.mat')
c2=load('Distance_c.mat')
d2=load('Distance_Hist.mat')
for i=1:80
aa=a2.DisA{1,i};%1x96
bb=b2.Distance_text1{1,i};%1x3
cc=c2.Distance_c{1,i};%1x4
dd=d2.Distance_Hist{1,i};%384x1
Features2{i}=[aa,bb,cc,dd'];%1x487
end
save('Features_Distance','Features2')
The error is
Reference to non-existent field 'DisA'.
Error in ==> main at 8
aa=a2.DisA{1,i};%1x96
the size of each one is
{1x80 cell}
  6 个评论
kash
kash 2011-12-23
Iget same error wen i change the name of .mat file
Chandra Kurniawan
Chandra Kurniawan 2011-12-23
I'm sorry.
Now, you don't need to rename your file.
Just do what I suggest for you below :)

请先登录,再进行评论。

采纳的回答

Chandra Kurniawan
Chandra Kurniawan 2011-12-23
No,
I have checked your file 'DisA.mat' and there is no variable named 'DisA'.
It's better if you try to change your code :
aa=a2.DisA{1,i}
with
aa{i} = a2.D{i}
  16 个评论
Chandra Kurniawan
Chandra Kurniawan 2011-12-23
Please show, how do you modify the first code?
kash
kash 2011-12-23
in my first code i get 4 values in a single cell,so i get 80 columns....
i want is inverse of that 4 column and 80 rows wirh wacs value in each separate cell

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Timing and presenting 2D and 3D stimuli 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by