%ee93wx1q.m question data for ee93wx1, rev tlyeh 93,4,22
['question 2, LED v-i data:'],
[' * R1f, R1r are R values in series with LED to convert iD to v for foreward and reverse region respectively,'],
[' x:vD1,iD1: 順向不亮的範圍, +:vD2,iD2:順向到達開始微亮的範圍, o:vD3,iD3:順向到達極亮的範圍, *:vDr,iDr: 反向產波器能測到的範圍,'], 
[' * (v_DH1,v_DV1) (v_DH2,v_DV2) (v_DH3,v_DV3) (v_DHr,v_DVr) are scope H & V scale for dark, little light, max light, and max reverse, respectively,'],
['data points, in unit of Division, cover knee area and asymptotically straight section.']

['R1f=199; R1r=19.7e3;']
 R1f=199; R1r=19.7e3; 
['v_DH1=1; v_DV1=20e-3;  v_DH2=.2; v_DV2=.1;  v_DH3=.5; v_DV3=2;  v_DHr=2; v_DVr=.1;']                    
 v_DH1=1; v_DV1=20e-3;  v_DH2=.2; v_DV2=.1;  v_DH3=.5; v_DV3=2;  v_DHr=2; v_DVr=.1; 
[' x:vD1,iD1: 順向不亮的範圍'], 
data1=[[0 1.4 1.45 1.5 1.6]*v_DH1; [0 0.01 .2 .4 3.]*v_DV1/R1f]; vD1=data1(1,:),iD1=data1(2,:),
['+:vD2,iD2:順向到達開始微亮的範圍'], 
data2=[[0 7 7.6 7.8 8.0 8.2 8.3]*v_DH2;[0 .05 .2 .5 1.2 3.8 4.3]*v_DV2/R1f]; vD2=data2(1,:),iD2=data2(2,:),
['o:vD3,iD3:順向到達極亮的範圍'],
data3=[[0 3 3.2 3.3 3.45 3.6 3.8 4 4.1]*v_DH3;[0 .005 .05 .2 .5 1.1 2.2 3.3 4.2]*v_DV3/R1f]; vD3=data3(1,:),iD3=data3(2,:),
['*:vDr,iDr: 反向產波器能測到的範圍,'], 
datar=[[-0 -5]*v_DHr;[-0 -2]*v_DVr/R1r]; vDr=datar(1,:),iDr=datar(2,:),
['datas=[datav";datai"] 是所有的數據依大小排列'],
 data=[data1,data2,data3,datar];
 [datai,k]=sort(data(2,:)'); datav=data(1,k)'; datas=[datav';datai'],
figure(1),figure(2), close(1),close(2), whitebg
figure(1), plot(data1(1,:)',-data1(2,:)','xk'), grid,  hold on; 
 plot(data2(1,:)',-data2(2,:)','+k'),   plot(data3(1,:)',-data3(2,:)','ok'), 
  plot(datar(1,:)',-datar(2,:)','*k'), 
 plot(datas(1,:)',-datas(2,:)',':'), 
title('LED v~i'), ylabel('-i'),xlabel(' x:vD1,iD1: 順向不亮, +_2:順向到達微亮, o_3:順向達極亮, *_r:反向'); 
hold off, 
figure(2), plot(data1(1,:)',-data1(2,:)','xk'), grid,  hold on; 
 plot(data2(1,:)',-data2(2,:)','+k'),
 % plot(datar(1,:)',-datar(2,:)','*k'), 
title('LED v~i'), ylabel('-i'),xlabel(' x:vD1,iD1: 順向不亮, +_2:順向到達微亮, o_3:順向達極亮, *_r:反向'); 
hold off, 
