With regards to the first warning:
A matrix used in a computation is singular or is very close to being singular (ill conditioned). Trying to solve a system of linear equations whose coefficient matrix is singular can lead to incorrect answers.
In your code, you are possibly using a matrix that is badly conditioned as one of the arguments to the forward slash (/) operator.
Solution: Determine the condition number of the coefficient matrix (the matrix on the right side of the forward slash (/) using the COND function. Large results for the condition number indicate the matrix is extremely ill-conditioned. You should verify (using the matrix multiplication operator (*)) that the result of solving the system is numerically reliable.
For more information about condition numbers of matrices, see Chapter 2: Linear Equations of the Cleve Moler's Numerical Computing with MATLAB book, which discusses solving systems of linear equations.
With regards to the second warning:
When there is a sharp change in the derivative of an ODE function, variable step integrators such as ODE15s reduce the step size in an attempt to satisfy the integration tolerances. Sometimes when the change is very sharp, the integrator attempts to reduce the step size below the smallest value allowed, and the following warning is generated:
Warning: Failure at t= XXXXX. Unable to meet integration tolerances without reducing the step size below the smallest value allowed at time t
To work around this, relax the integration tolerances and run the simulation again.
Hope this helps!