Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例えば
A=[0 0 0; 1 1 1; 1 0 0; 1 1 0; 0 0 1];
機能適用後
A=[1 1 0; 1 1 0; 1 1 0; 1 0 1];
1 つの行は 1 つのゼロで、残りは 1 です。すべてが 1 の場合、ランダムにゼロを 1 つ入れます。複数のゼロが見つかった場合は、ランダムなゼロを取得し、すべてのゼロを 1 に変換します。