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.
たとえば、2つの値のマトリックスがあります。
[ 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 1 ]
「1」から「0」である行の他のすべての要素を変更したいので、出力は次のようになります。
[ 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 ]
マトリックスが次のm場合は、次のことができます。
m
ind=find(m(:)==1); m(ind(1:2:end))=0;