index exceeds array bounds

2 visualizaciones (últimos 30 días)
Chaudhary P Patel
Chaudhary P Patel el 30 de Sept. de 2020
Respondida: KSSV el 30 de Sept. de 2020
%%%%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 comentarios
KALYAN ACHARJYA
KALYAN ACHARJYA el 30 de Sept. de 2020
Sir, Sure I will try
KSSV
KSSV el 30 de Sept. de 2020
@Pramod we cannot help you unless we know your complete code and the variables.

Iniciar sesión para comentar.

Respuestas (1)

KSSV
KSSV el 30 de Sept. de 2020
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

Categorías

Más información sobre Cell Arrays en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by