Can anyone help me to write a MATLAB script like the one attached?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Akzeptierte Antwort
Meg Noah
am 8 Jan. 2020
Bearbeitet: Meg Noah
am 8 Jan. 2020
Yes. It's not exact, and the arrow is kludged but I hope it is good enough:
clc
clear all
close all
fig = figure('color','white','position',[40 300 700 475]);
hold on;
xlim([0 6]);
ylim([-6.5 -2.5]);
set(gca,'ydir','normal');
set(gca,'ytick',-6.5:0.5:-2.5);
ylabelString = get(gca,'yticklabel');
ylabelString{1} = 'HOMO';
ylabelString{end} = 'LUMO';
plot(0.02,-2.5,'^','markersize',10,'markerfacecolor','k','markeredgecolor','k');
set(gca,'linewidth',3);
set(gca,'yticklabel',ylabelString);
ylabel('Energy gap (eV)');
set(gca,'xtick',[]);
set(gca,'xcolor',[1 1 1]);
set(gca,'fontweight','bold');
set(gca,'fontsize',12);
% each energy transition
itransition = 0;
energy = -4.7;
plot([itransition+0.5 itransition+1],[energy energy],'k','Linewidth',5);
text(itransition+0.75,energy+0.25,num2str(energy,'%.2f'), ...
'horizontalalignment','center','fontsize',12,'fontweight','bold');
text(itransition+0.75,energy-0.25,'ITO', ...
'horizontalalignment','center','fontsize',12,'fontweight','bold');
itransition = 1;
energy1 = -5.2;
plot([itransition+0.5 itransition+1],[energy1 energy1],'k','Linewidth',5);
text(itransition+0.75,energy1-0.25,num2str(energy1,'%.2f'), ...
'horizontalalignment','center','fontsize',12,'fontweight','bold');
text(itransition+0.75,energy1-0.5,'P3HT', ...
'horizontalalignment','center','fontsize',12,'fontweight','bold');
energy2 = -3.2;
plot([itransition+0.5 itransition+1],[energy2 energy2],'k','Linewidth',5);
text(itransition+0.75,energy2+0.25,num2str(energy2,'%.2f'), ...
'horizontalalignment','center', ...
'fontsize',12,'fontweight','bold');
h = text(itransition+0.75,(energy1+energy2)/2,'E_g=2.00', ...
'horizontalalignment','center', ...
'fontsize',12,'fontweight','bold');
set(h,'Rotation',90);
itransition = 2;
energy1 = -5.56;
plot([itransition+0.5 itransition+1],[energy1 energy1],'k','Linewidth',5);
text(itransition+0.75,energy1-0.25,num2str(energy1,'%.2f'), ...
'horizontalalignment','center','fontsize',12,'fontweight','bold');
text(itransition+0.75,energy1-0.5,'AS1', ...
'horizontalalignment','center','fontsize',12,'fontweight','bold');
energy2 = -3.39;
plot([itransition+0.5 itransition+1],[energy2 energy2],'k','Linewidth',5);
text(itransition+0.75,energy2+0.25,num2str(energy2,'%.2f'), ...
'horizontalalignment','center', ...
'fontsize',12,'fontweight','bold');
h = text(itransition+0.75,(energy1+energy2)/2,'E_g=2.17', ...
'horizontalalignment','center', ...
'fontsize',12,'fontweight','bold');
set(h,'Rotation',90);
itransition = 3;
energy1 = -5.38;
plot([itransition+0.5 itransition+1],[energy1 energy1],'k','Linewidth',5);
text(itransition+0.75,energy1-0.25,num2str(energy1,'%.2f'), ...
'horizontalalignment','center','fontsize',12,'fontweight','bold');
text(itransition+0.75,energy1-0.5,'AS2', ...
'horizontalalignment','center','fontsize',12,'fontweight','bold');
energy2 = -3.45;
plot([itransition+0.5 itransition+1],[energy2 energy2],'k','Linewidth',5);
text(itransition+0.75,energy2+0.25,num2str(energy2,'%.2f'), ...
'horizontalalignment','center', ...
'fontsize',12,'fontweight','bold');
h = text(itransition+0.75,(energy1+energy2)/2,'E_g=1.93', ...
'horizontalalignment','center', ...
'fontsize',12,'fontweight','bold');
set(h,'Rotation',90);
itransition = 4;
energy1 = -6;
plot([itransition+0.5 itransition+1],[energy1 energy1],'k','Linewidth',5);
text(itransition+0.75,energy1-0.25,num2str(energy1,'%.2f'), ...
'horizontalalignment','center','fontsize',12,'fontweight','bold');
energy2 = -4.3;
plot([itransition+0.5 itransition+1],[energy2 energy2],'k','Linewidth',5);
text(itransition+0.75,energy2+0.25,num2str(energy2,'%.2f'), ...
'horizontalalignment','center', ...
'fontsize',12,'fontweight','bold');
h = text(itransition+0.75,(energy1+energy2)/2,'PC_{61}BM', ...
'horizontalalignment','center', ...
'fontsize',12,'fontweight','bold');
itransition = 5;
energy = -4.3;
plot([itransition+0.5 itransition+1],[energy energy],'k','Linewidth',5);
text(itransition+0.75,energy+0.25,num2str(energy,'%.2f'), ...
'horizontalalignment','center','fontsize',12,'fontweight','bold');
text(itransition+0.75,energy-0.25,'Al', ...
'horizontalalignment','center','fontsize',12,'fontweight','bold');
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Array Geometries and Analysis finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!