% Solution 4-20.a for index=1:length(a) if a(index)>0 b(index) = true; else b(index) = false; end end