MATLAB: Add 8 to the elements of matrix a=[1 7 5 7 2 3 8 2 9 5] that are higher than 3

MATLAB

how can I add 8 to the elements of matrix a=[1 7 5 7 2 3 8 2 9 5] that are higher than 3 without using the for loop? The desired result is matrix b=[1 15 13 15 2 3 16 2 17 13].

Best Answer

a( a > 3 ) = a( a > 3 ) + 8