Info

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

I want the ones of a binary array to exchange positions with all the zeros and store the result in other array with each iteration.

1 回表示 (過去 30 日間)
Muhammad
Muhammad 2022 年 8 月 22 日
閉鎖済み: John D'Errico 2022 年 8 月 30 日
a=[1 1 1 0 0 ]
i want it to be like this
a1=[1 1 0 1 0]
a2=[1 1 0 0 1]
then i want the second member (1) to move th position of zeros step by step like
a3=[1 0 1 1 0]
a4=[1 0 1 0 1]
and rhe same for the first member

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by