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 27 28 29 30 31 32 33 34 35 36
| ai=analoginput('nidaq',1);
ao=analogoutput('nidaq',1);
ic=addchannel(ai,[2 0]);
ic.inputrange=[0 10];
ic(1).SensorRange=ic(1).InputRange;
ic(1).UnitsRange=ic(1).InputRange;
ic(1).ChannelName='Vds';
ic(2).UnitsRange=ic(2).InputRange*10;
ic(2).SensorRange=ic(2).InputRange;
ic(2).Units='mA';
ic(2).ChannelName='Id';
oc=addchannel(ao,[0 1]);
oc.UnitsRange=oc(1).OutputRange;
oc(1).ChannelName='Vin';
oc(2).ChannelName='Vgg';
Vds=[];
Id=[];
VgsList=[-4.5:0.5:0];
for Vgs=VgsList
data=[]
for Vgg=5:0.25:5
putsample(0,[Vin,Vgg]);
data=[data; getsample(ai)];
end
Vds=[Vds data(:,1)]; %toute les lignes, 1ére collone
Id=[Id data(:,2)]; %toute les lignes, 2ére collone
end
legendStr={};
for Vgg=1:length(VggList),
legendStr{VggCt}=[num2Str(VggList(VggCt)) 'V'];
end
h=plot(Vds,Id);
legend(h(0:end),legendStr(0:end));
xlabel('V {ds} (V)');
ylabel('I {d} mA');
title('\bf{Lines of constant V {gs} for JFET'); |
Partager