📄 findbandgap.m
字号:
%function [dth,wh0,dte,we0,dthe,whe0]=findbandgap(OH,OE)
%Find a large bandgap of OH and OE,respectively.
%dth=the bandgap of OH
%dte=the bandgap of OE
%wh0=the midfrequency of the OH's bandgap
%we0=the midfrequency of the OE's bandgap
%----------------------------OH-----------------------------------------
ch=(size(OH));
for n=1:(ch(2)-1)
dtm=min(OH(:,n+1))-max(OH(:,n));
if dtm<10e-5
dtm=0;
end
dt1(n)=dtm;
end
dth=max(dt1); %dth=the bandgap of OH
s=find(dt1==dth);
ohgapmin=max(OH(:,s));
ohgapmax=min(OH(:,s+1));
wh0=ohgapmin+(dth/2); %midfrequency of the OH's bandgap
%----------------------------OE-----------------------------------------
ce=(size(OE));
for n=1:(ce(2)-1)
dtme=OE(:,n+1)-OE(:,n);
dt1e(n)=min(dtme);
end
dte=max(dt1e); %dte=the bandgap of OE
s1=find(dt1e==dte);
oegapmin=max(OE(:,s1));
oegapmax=min(OE(:,s1+1));
we0=oegapmin+(dte/2); %midfrequency of the OE's bandgap
%----------------------------OHE-----------------------------------------
OHE=[OH,OE]; %to find the co-bandgap of OH and OE
che=ch(2)+ce(2);
for m=1:ch(1)
OHE(m,:)=sort(OHE(m,:));
end
clear dtmhe
dtmhe=0;
dtheee=zeros(1,che-1);
for n=1:(che-1)
dthee=min(OHE(:,n+1))-max(OHE(:,n));
if dthee<10e-5
dthee=0;
end
dtheee(n)=dthee;
end
dthe=max(dtheee); %dthe=the bandgap of OHE
s2=find(dtheee==dthe);
ohegapmin=max(OHE(:,s2)); %the bottom of the gap
ohegapmax=min(OHE(:,s2+1)); %the top of the gap
whe0=ohegapmin+(dthe/2); %midfrequency of the OHE's bandgap
disp('ohegap end')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -