how to write the code for te charging equation of a capacitor in matlab

Status
Not open for further replies.

pankaj jha

Full Member level 3
Joined
Apr 16, 2010
Messages
170
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
jaipur
Activity points
2,457
hello everyone
i am working on simulink.

i have a system where i sample my signal using sample and hold block from simulink library. Then i have to use a "Matlab Embedded" block from the "User defined" sublibrary.
The "Matlab Embedded" block should have the equation of charging a capacitor which charges during thr hold time of the sample and hold circuit.

i am trying to write the equation for charging of a capacitor.

Vo = Vin(nT)*(1-exp(-t/30)); for nT< t<(n+1)T.

where, the T=hold time for a sample and hold circuit.

I have to write this equation in matlab. Can anyone suggest me the code....
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…