参考:http://www.ilovematlab.cn/thread-554817-1-1.html
sub2ind(matrixSize,rowSub,colSub)行列索引转为单索引,然后求和,如sum(A(sub2ind(size(A),row,col)))
参考:http://www.ilovematlab.cn/thread-554817-1-1.html
sub2ind(matrixSize,rowSub,colSub)行列索引转为单索引,然后求和,如sum(A(sub2ind(size(A),row,col)))