Find in matlab

suppose you want to select the upper triangle matrix of M and put it in a vector v

[m n] = size(M);

idx = triu(ones(m),1);

v = M(find(idx==1));

A fast version would be

v = M(logical(idx==1));

Linux show disk usage

du –max-depth=1 -mc -h | sort -n

Follow

Get every new post delivered to your Inbox.