My Blog List
Sunday, March 25, 2012
Saturday, March 24, 2012
[转载]Matlab向量化优化小结
1、给定一个列向量v1,和一个行向量v2, 计算矩阵M,使得M(i, j) = v1(i) + v2(j)。一种常用的向量化实现:m = length(v1);
n = length(v2);
M = repmat(v1, [1, n]) + repmat(v2, [m, 1]);
n = length(v2);
M = repmat(v1, [1, n]) + repmat(v2, [m, 1]);
Subscribe to:
Posts (Atom)