I understand that you are able to run grid world for discrete U, L, D, R actions and are trying it with continuous action space.
The correct way of creating a continuous action space with your requirements is -
actInfo = rlNumericSpec([2 1], 'LowerLimit', -5, 'UpperLimit' ,5);
But, as per my understanding, it is not possible to use continuous action space in grid world with MATLAB. You can however create different discrete actions by creating custom grid world environments, particularly the Actions property of the grid world model.
Hope this helps.