summaryrefslogtreecommitdiff
path: root/Working_Examples/154/CH11/EX11.1/ch11_1.sce
blob: b2eb628adbde8f435813c803a5009f723a89d147 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
clc
disp("Problem 11.1")
printf("\n")

printf("Given")
disp("Resistance =1000ohm")
t=0:0.5:1;
i=ones(length(t),1) ;i1=-1;
figure
a=gca()
plot(t,i,t+1,i1,t+2,i,t+3,i1)
xtitle("i vs t",'t in ms','i in mA')
i=1*10^-3;R=1000;
//p=i^2*R
p=i^2*R*ones(length(t),1) ;
figure
a=gca()
plot(t,p)
xtitle("p vs t",'t in ms','p in mW')