PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

172 Practical MATLAB® Applications for Engineers


figure(3)
inti = int(iamps);
ezplot (inti,[0,3])
xlabel(‘ time ‘);ylabel(‘integral[i(t)]’);
title(‘integral[i(t)] vs t’);grid on;
figure(4)
diffi = diff(iamps);
ezplot(diffi,[0,3])
xlabel(‘ time ‘);ylabel(‘d[i(t)/dt]’);
title(‘d[i(t)/dt] vs t’);grid on;
figure(5)
Vr = 1000*iamps;
ezplot(Vr,[0,3])
xlabel(‘ time ‘);ylabel(‘Vr(t)in volts’);
title(‘Vr(t) vs t’);grid on;
figure(6)
Vl = 30e-3*diffi;
ezplot(Vl,[0,3])
xlabel(‘ time ‘);ylabel(‘VL(t)in volts’);
title(‘VL(t) vs t’);grid on;
figure(7)
Vc=.5e-6*inti;
ezplot(Vc,[0,3])
title(‘Vc(t) vs t’)
xlabel(‘ time ‘);ylabel(‘Vc(t)in volts’)
title(‘ Vc(t) vs t’);grid on;
figure(8)
Vlr=Vl+Vr;
ezplot(Vlr,[0,3])
title(‘[Vr(t)+VL(t)] vs t’);xlabel(‘ time ‘);
ylabel(‘[Vr(t)+VL(t)] in volts’);grid on;
figure(9)
Vcr=Vc+Vr;
ezplot(Vcr,[0,3])
title(‘[Vr(t)+Vc(t)] vs t’)
xlabel(‘ time ‘);ylabel(‘[Vr(t)+Vc(t)]’);
title(‘[Vr(t)+Vc(t)] vs t’);grid on
figure(10)
Pr = iamps*Vr;
ezplot(Pr,[0,3])
title(‘Pr(t) vs t’)
xlabel(‘ time ‘)
ylabel(‘Pr(t) in watts’);grid on;
figure(11)
Pl = iamps*Vl;
ezplot(Pl,[0,3])
title(‘PL(t) vs t’); xlabel(‘ time ‘);
ylabel(‘PL(t)’);grid on
figure(12)
Pc = iamps*Vc; ezplot(Pc,[0,3]);
Free download pdf