From: Bruno Luong on
"vortse a" <sonoffeanor-remove(a)yahoo.com> wrote in message <hpkica$1ja$1(a)fred.mathworks.com>...
> You can use triu on a logical matrix and avoid using nonzeros:
>
> >>B=A(triu(true(size(A))))
>
> However this aggregates B columnwise. If this is unwanted, then there is some transposing to be done, but I was unable to conjure it.

B = A.';
b = B(tril(true(size(B))))

Bruno
From: vortse a on
So I guess there is no way to do it with an in-place computation, is there?
From: AlexHuber Huber on
"vortse a" <sonoffeanor-remove(a)yahoo.com> wrote in message <hpktrm$msa$1(a)fred.mathworks.com>...
> So I guess there is no way to do it with an in-place computation, is there?

For me the solutions you guys found are already quite fine for me purpose!
Thank you!