MATLAB - Allowing only numeric input using Exception Handling
because assert requires a user message when the assert occurs THEN the try/catch will work

You want something like this:

a = 'a';
try
    assert(isnumeric(a),'Not a number AAAA');

catch foo
    warning('Not a number');
end
1+1


As you can see the assert message is caught and the user WARNING is shown.

Alternatively you can use a function that will fail on non-number to remove the need of assert.

a = 'a';
try
    mustBeNumeric(a)

catch foo
    warning('Not a number');
end
1+1