I currently have the following code:
t = [ - 10e-6 : 1e-8 : 150e-6];
Vc(t<0) = 4.604;
Req = 6.334e3;
C = 2.7e-9;
tau = Req * C;
Vc(t>0) = 4.604 * (1 + exp(-t / tau));
title('Capacitor Voltage vs Time');
I need to plot the DC voltage before time is 0 as a flat line at 4.604V, then after as an exponential decay.
Have been trying for a while and can't seem to get it. Any tips would be very appreciated!