As mentioned in the error,
" Examine the configurations of 'Gazebo Robot/MATLAB Function' for one of
the following scenarios:
1. The block does not enable 'Support variable-size arrays'.
2. The input data 'u' does not enable 'Variable size'."
The input 'u' of "MATLAB Function" should be variable size.
To make that, you need to do following changes in "MATLAB Function" "Model Explorer"
You can open "Model Explorer" by right click on "MATLAB Function" block.