How to show conditional values in a matrix responding to a selected value on an upper input?