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 つの行列 (A、B) があり、要素ごとの差を計算したいと考えています。次に、一致しない要素には 0 を、それ以外の場合は 1 を返します (一致する要素またはそれらの差が 0 である要素の場合)。matlabに機能はありますか?
を使用して、行列の要素が同一であるかどうかをテストできます==。
==
A = [1 2 3]; B = [1 0 3]; C = A == B; % gives C = [1 0 1]