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,B),我想计算逐个元素的差异。然后,我想为不匹配的元素给我 0,否则给我 1(对于匹配的元素或它们的差异为 0 的元素)。matlab有什么功能吗?
您可以使用 测试矩阵的元素是否相同==。
==
A = [1 2 3]; B = [1 0 3]; C = A == B; % gives C = [1 0 1]