summaryrefslogtreecommitdiff
path: root/69/CH8/EX8.4/8_4.sce
blob: 14bdf700db5f9ba66c8592a7cdaea30c9f8a7802 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
clear; clc; close;

Idss = 8*10^(-3);
Vp = -4;

gmo = 2*Idss/abs(Vp);

Id1 = 0;
gm1 = gmo*(sqrt(Id1/Idss));
Id2 = Idss/4;
gm2 = gmo*(sqrt(Id2/Idss));
Id3 = Idss/2;
gm3 = gmo*(sqrt(Id3/Idss));
Id4 = Idss;
gm4 = gmo*(sqrt(Id4/Idss));

x = [Id1 Id2 Id3 Id4];
y = [gm1 gm2 gm3 gm4];
yi=smooth([x;y],0.0005);
a = gca();
a.thickness = 2;
a.y_location = 'left';
a.x_label.text = 'Id(mA)';
a.y_label.text = 'gm(S)';
a.title.text = 'gm vs Id';
plot2d(yi(1,:)',yi(2,:)',[3]);