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.
我需要将矩阵第一列中出现的数次 (5) 替换为 -1。我该怎么做?
试试这个:
A(A(:,1)==5,1) = -1
希望这可以帮助。