Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

how to make status array (like status=010) instead of status variable which holding one value

1 visualización (últimos 30 días)
how to make status array (like status=010) instead of status variable which holding one value

Respuestas (1)

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh el 12 de Mzo. de 2014
if true
% code
endMake a array as such
status(1:3)=[0 1 0]
then you can call status(1) and it will show you 0 I'm not sure if your problem was so easy to be solved! I probably don't understand your question!
  2 comentarios
Biswajit
Biswajit el 12 de Mzo. de 2014
my case is like this
for i = 1 : n1 for j = 1 : m1 for k =1 : 4 if(B{i,j}== 0) status=0; else status=1; end
end
end
end
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh el 12 de Mzo. de 2014
Editada: Salaheddin Hosseinzadeh el 12 de Mzo. de 2014
Ok! Try this then
status=[]; %predefining an epmty status
for i = 1 : n1
for j = 1 : m1
for k =1 : 4
if(B{i,j}== 0)
status=[status,0];
else
status=[status,1];
end
end
end
end
Hope this helps!

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by