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.
我有两个矩阵,一个是 1x153 double 的,另一个是 153x512 double 的矩阵,我需要在不可能的情况下减去它们,并且给我错误的是它们的尺寸不同。
知道如何解决它吗?
使用bsxfun:
A = rand(1,153); B = rand(153,152); bsxfun(@minus,A.', B);
请注意,我首先转置A,因为至少需要匹配一个维度。
A