//Chapter-12, Example 12.18, Page 365 //============================================================================= clc clear //During the positive 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 12V with polarities and it behaves like a battery. //during the negative half of the input signal,the diode does not conduct and acts like an open circuit.Hence the output voltage ,V0=-24V.This gives negatively clamped voltage. mprintf("V0=0V\n") mprintf("output voltage V0=-24V") //=================================END OF PROGRAM=======================================================================================================