You can get the required RLC equations using odeToVectorField function. However, for education purposes, please follow along.
Given the RLC system as follows
First, divide the equation by L to make the coefficient of the highest order term (
), becomes 1.
Then, move all terms on the left-hand side except for the highest order term, to the right-hand side.
Note that the RHS has 3 variables with two are the system states {
} and one is the system input {
}.
If we let
,
, and
, then the 2nd-order RLC system can be rewritten as a system of 1st-order ODEs:

This model representation of the dynamics is called the state-space model, having the form 
I haven't run you code, but in MATLAB code, you can write something like this:
f1 = @(x,y1,y2) y2;
f2 = @(x,y1,y2) - (1/(L*C))*y1 - (R/L)*y2 + (1/L)*Et;

