参考:http://www.ilovematlab.cn/thread-554817-1-1.html
https://ww2.mathworks.cn/help/matlab/ref/sub2ind.html?searchHighlight=sub2ind&s_tid=doc_srchtitle
sub2ind(matrixSize,rowSub,colSub)行列索引转为单索引,然后求和,如sum(A(sub2ind(size(A),row,col)))
参考:http://www.ilovematlab.cn/thread-554817-1-1.html
https://ww2.mathworks.cn/help/matlab/ref/sub2ind.html?searchHighlight=sub2ind&s_tid=doc_srchtitle
sub2ind(matrixSize,rowSub,colSub)行列索引转为单索引,然后求和,如sum(A(sub2ind(size(A),row,col)))