function Analyse_UV( ConcnVector )
close all
clc
NPConc = 20;
[NUM,TXT,NAW] = xlsread('Test1.xls');
ConcnVector = ConcnVector';
for i=1:1:length(ConcnVector);
legend2{i}=num2str(ConcnVector(i))';
end
dim=size(NUM);
imax=(dim(1,2));
for
i=1:2:imax
headings0(i)=[TXT(1,i)];
end
headings=headings0';
headings(cellfun(@isempty,headings))=[];
NcolNUM = size(NUM,2);
if NcolNUM >2
NUM2 = zeros(size(NUM,1),size(NUM,2));
LOWER = NUM(1,2);
for i=1:2:imax
UPPER = NUM(1,i+1);
NUM2(:,i+1) = NUM(:,i+1)-(UPPER-LOWER);
NUM2(:,i) = NUM(:,i);
end
end
NUM = NUM2;
SetSize = 0.5*size(NUM,2);
Results = zeros(SetSize,3);
PlotNum = ceil(SetSize*0.5);
Set = 1;
figure;
hold all
for i=1:2:imax
y = NUM(:,i:i+1);
[SPR, FWHM, lmerr, xdataf, ydataf,SPRBandf] = Average_UV_13nm(y);
Results(((i+1)/2),1) = SPR;
Results(((i+1)/2),2) = FWHM;
Results(((i+1)/2),3) = lmerr;
subplot(2,PlotNum,Set);
plot(xdataf,ydataf,'-','linewidth',1.5);
hold on
plot(xdataf,SPRBandf,'--','linewidth',1.5);
title(headings((i+1)*0.5), 'FontSize',12);
xlim([450 620])
Set = Set+1;
j = (i+1)/2;
Abs(j) = max(SPRBandf);
if i == imax-3
IniAbs = max(SPRBandf);
end
if i == imax-1
FinAbs = max(SPRBandf);
end
xlim([400 650]);
end
figure;
plot(xdataf,ydataf,'-','linewidth',1.5);
hold on
plot(xdataf,SPRBandf,'--','linewidth',2);
title('Example of UV/Vis Data with SPR Fit', 'FontSize',18);
xlabel('\lambda /nm', 'FontSize',16);
ylabel('Absorbance', 'FontSize',16);
SampleHeadings = {'UV/Vis Data','Levenberg-Marquandt fitting of SPR band'};
legend(SampleHeadings,'FontSize',16,'Location','NorthEast');
set(gca,'FontSize',13)
L = length(NUM);
figure;
for i=2:2:imax
hold all;
axis([400 800 0 2.2])
plot(double(NUM(1:L,1)),double(NUM(1:L,i)),'linewidth',2);
set(gca, 'XTick', 0:50:800, 'FontSize',12);
end
Last = NUM(:,end);
JJJ = max(Last(1:350))*1.2;
axis([400 800 0 JJJ])
legend(headings,'FontSize',13,'Location','SouthWest');
title('UV/Vis Absorption of Au^1^3NPs', 'FontSize',18);
xlabel('\lambda /nm', 'FontSize',20);
ylabel('Absorbance', 'FontSize',20);
figure;
uitable('Data', Results, 'ColumnName', {'SPR', 'FWHM', 'lmerr'},'RowName', headings,'Position', [20 20 1000 400]);
SPR = Results(:,1);
SPR = SPR(:,1)-SPR(1,1);
FWHM = abs(Results(:,2));
FWHM = FWHM(:,1)-FWHM(1,1);
figure;
plot(ConcnVector,SPR,'--o','linewidth',2,'markers',9);
hold on
plot(ConcnVector,FWHM,'--*','linewidth',2,'markers',9);
axis auto
set(gca,'FontSize',13)
xlim([ConcnVector(1),ConcnVector(end)+1]);
ylim([0,SPR(end)+2]);
xlabel('Concentration of pHLIP/ \muM', 'FontSize',18);
ylabel('\Delta\lambda /nm', 'FontSize',18);
SPR_Headings = {'Surface Plasmon Resonance \lambda_m_a_x','Full Width at Half Maximum'};
legend(SPR_Headings,'FontSize',13,'Location','NorthEast');
figure;
MaxAbs = max(Abs)*1.2;
MinAbs = min(Abs)*0.8;
[haxes,hline1,hline2] = plotyy(ConcnVector,SPR,ConcnVector,Abs);
set(hline1,'linewidth',1.5);
set(hline2,'linewidth',1.5);
set(haxes(2),'YLim',[MinAbs MaxAbs]);
set(haxes(2), 'YTick', MinAbs:0.2:MaxAbs, 'FontSize',13);
set(haxes(1),'YLim',[0 SPR(end)+2]);
set(haxes(1), 'YTick', 0:1:SPR(end)+4, 'FontSize',13);
ylabel(haxes(1),'\Delta\lambda /nm', 'FontSize',18);
ylabel(haxes(2),'Absorbance', 'FontSize',18)
xlim([ConcnVector(1),ConcnVector(end)+1]);
set(hline1,'Marker','o','MarkerSize',9);
set(hline1,'LineStyle','--');
set(hline2,'Marker','+','MarkerSize',9);
set(hline2,'LineStyle','--');
hold on
hline3 = plot(ConcnVector,FWHM,'-');
set(hline3,'linewidth',1.5);
set(hline3,'Marker','*','MarkerSize',9);
set(hline3,'LineStyle','--');
SPR_Headings2 = {'Surface Plasmon Resonance \lambda_m_a_x','Full Width at Half Maximum','Absorption'};
legend(SPR_Headings2,'FontSize',13,'Location','NorthWest');
xlabel('Concentration of EuL /\muM','FontSize',18);
set(haxes(2),'XLim',[ConcnVector(1),ConcnVector(end)+0.1]);
set(haxes(1),'XLim',[ConcnVector(1),ConcnVector(end)+0.1]);
set(haxes(2),'XTick',[])
set(haxes(1),'Box','off')
set(haxes(1),'FontSize',14);
xlim([ConcnVector(1),ConcnVector(end)+0.1]);
end