Can anyone explain me why the code below doesnt work and returns me
W = [.34 .34 ];
DG = sparse([1 2],[2 3],W);
UG = tril(DG + DG')
??? Error using ==> plus Matrix dimensions must agree.
and the code below works properly ?
W = [.34 .34 .34];
DG = sparse([1 2 3],[2 3 1],W);
UG = tril(DG + DG')