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.

조회 수: 2 (최근 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