y = sym('y',[1 length(t)])
then y will become a vector of variable names, y1, y2, y3, and so on up to y18001
ode=diff(y,t(i))==(-1/(R*C))*y + (1/C)*x_t(t(i))
you try to differentiate those 18001 different individual independent variables, each with respect to the numeric value from t(i) such as 0.0178 . That is not a permitted operation: you have to differentiate with respect to a variable, or else you have to specify the differentation order (number of times to differentiate) as a non-negative integer. If you try to interpret the t(i) as a fractional differentiation order, then in that case you would be differentiating each independent variable with respect to itself, which would have a result of 1 except for order 0.
On the right hand side of the == then y will be the entire vector of 18001 variables. After that, t(i) is one individual numeric value, and x_t(t(i)) would be a request to index x_t() at the location given by the numeric value in y(t) -- an indexing that could only work for the one location where y(t) is 1 exactly.
If you could manage to get that equation to work (such as by more selective indexing) you would have the bug that you are overwriting tge variable ode each time through the loop.