Matlab编程技巧

1. sum(dot(A,B,1)) 一般比 trace(A'*B) 效果更好

2. A * diag(w)  <=>  bsxfun(@times, A,w'),  diag(w)*A   <=>  bsxfun(@times, w,A)

3. 判断变量x是否存在:if(exist('x'))

posted @ 2013-05-27 19:40  ganzhao  阅读(135)  评论(0编辑  收藏  举报