MATLAB: Matrix manipulation

matrix manipulation

Have this:
fixed = [0 1 1 1 0];
w = [120 170 100 85 100];
Trying to get this:
fixedw = [170 100 85];

Best Answer

fixedw= w(logical(fixed))
Related Question