looks so easy but makes big problems!

6 visualizaciones (últimos 30 días)
omid kim
omid kim el 28 de Nov. de 2012
hi Im an amateur programmer!!!!!!!! take a look at this
for j=1:b
if s(i1,j)==s(i2,j)
v{i1,i2}(1,j)=0;
end
if s(i1,j)~=s(i2,j)
v{i1,i2}(1,j)=1;
end
if j==b
y=sum(v{i1,i2});
end
if y==1 && v{i1,i2}(1,j)==1
w{i3}(h,:)=s(i1,:);
w{i3}(h,j)=9;
h=h+1;
end
end
when I run it, it has this error: ??? Undefined function or variable 'y' who knows what the problem is????????

Respuesta aceptada

Matt J
Matt J el 28 de Nov. de 2012
Editada: Matt J el 28 de Nov. de 2012
If y isn't created until j==b
if j==b
y=sum(v{i1,i2});
end
then for j<b, this line won't be able to find y
if y==1 && v{i1,i2}(1,j)==1
  2 comentarios
omid kim
omid kim el 28 de Nov. de 2012
how should I fix it?
Matt J
Matt J el 28 de Nov. de 2012
define y for j<b

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by