index exceeds array bounds

1 次查看(过去 30 天)
Chaudhary P Patel
Chaudhary P Patel 2020-9-30
回答: KSSV 2020-9-30
%%%%I am trying to create a programm which gets values from an excel file
for fl=1:1:dof(de,4)
for i=1:1:ne
CKx(fl)=sum(b(i)*ckx(i))./sum(b(i));
CKy(fl)=sum(c(i)*cky(i))./sum(c(i));
end
end
  9 个评论
KSSV
KSSV 2020-9-30
@Pramod we cannot help you unless we know your complete code and the variables.

请先登录,再进行评论。

回答(1 个)

KSSV
KSSV 2020-9-30
m = dof(de,4) ; % I hope this is a number
ne = length(b) ; % dimensions of b and ckx, cky should be same
Ckx = cell(m,ne) ; % cell because I assume the ouput stored is array as you have used ./
Cky = cell(m,ne) ;
for fl=1:1:m
for i=1:1:ne
CKx{fl,i}=sum(b(i)*ckx(i))./sum(b(i));
CKy{fl,i}=sum(c(i)*cky(i))./sum(c(i));
end
end

类别

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

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by