Supply the ‘t’ argument even if the code does not use it.
Try this —
t=[0 5];
inity = 1;
[t,y]=ode45(@f, t, inity);
plot(t,y)
function dy = f(t,y)
% y=[9,100]; dont overwrite y
D=0.00000001;
F=96485;
Z=0.000000016;
R=0.08206*298;
C=0.05;
J=-((D*Z*F*C)/R);
dy = J.*y;
end
.