フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
Biswajit
Biswajit 2014 年 3 月 12 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
how to make status array (like status=010) instead of status variable which holding one value

回答 (1 件)

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014 年 3 月 12 日
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 件のコメント
Biswajit
Biswajit 2014 年 3 月 12 日
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 2014 年 3 月 12 日
編集済み: Salaheddin Hosseinzadeh 2014 年 3 月 12 日
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!

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by