//Chapter-12, Example 12.17, Page 364 //============================================================================= clc clear //During the negative half of the input signal,the diode conducts,and acts like a short circuit.Now,the output voltage,V0=0V.The capacitor is charged to 10V with polarities and it behaves like a battery. //During the positive half of the input signal,the diode does not conduct,and acts like an open circuit.Hence,the output voltage,V0=20V.This gives positively clamped voltage. mprintf("V0=10+10=20 V") //=================================END OF PROGRAM=======================================================================================================