Borrar filtros
Borrar filtros

last cell is storing too many garbage values

1 visualización (últimos 30 días)
SOUVIK DATTA
SOUVIK DATTA el 17 de Mayo de 2019
Comentada: Guillaume el 17 de Mayo de 2019
whenever i am running this loop the last cell is storing too many (say 200) garbage values along with the actual values, how to remove them?.
y3=0;
for i=1:1
for j2=2:dl
h1 =sqrt(( xcor(i)- xcor(j2))^2 + ( ycor(i)- ycor(j2))^2);
for i1=2:8
if (h1 > LagClass(i1-1) & h1<= LagClass(i1-1)+lagint)
y3=y3+1;
GradeInClass{i1}(y3,:)= z(j2);
end
end
end
end
Thank you,
souvik
  1 comentario
Guillaume
Guillaume el 17 de Mayo de 2019
Your code has no comment explaining what it's meant to do. How can we tell what is wrong with it?
Certainly, this line:
GradeInClass{i1}(y3,:)= z(j2);
is very bizarre. For a start you're using : which implies you're going to store a vector in GradeInClass{i1} but you're storing the scalar value z(j2). Secondly, since y3 increments each time you're storing something, you're going to end up with lots of empty rows in each GradeInClass element.
It's very unclear what you're trying to do but I would suspect that the line above is completely wrong.
Also puzzling:
for i = 1:1
This is only going to run once. It's just equivalent to
i = 1;

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by