Is there any other way to re-code this function (perhaps with for loop):
mmm = [2;3;4;8;9;11;13;14;15;16];Dmm = zeros(2*size(mmm),1);Dmm = reshape(bsxfun(@minus,2*repmat(mmm,1,2),[1 0])',1,[])'
arrayfor loopmatrix manipulationreshape
mmm = [2;3;4;8;9;11;13;14;15;16];Dmm = zeros(2*size(mmm),1);Dmm = reshape(bsxfun(@minus,2*repmat(mmm,1,2),[1 0])',1,[])'
Best Answer