-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabsfluplotter.m
More file actions
79 lines (77 loc) · 2.42 KB
/
absfluplotter.m
File metadata and controls
79 lines (77 loc) · 2.42 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
%Corrected Absorbance/Fluorescence data plotting script (LCG) 08/2011
color = ['b' 'g' 'r' 'c' 'm' 'y' 'k' ':b' ':g' ':r' ':c' ':m' ':y' ':k'];
i = input('how many samples do you have? ');
l = input('add legend to plot? (y/n) ','s');
filetype = input('is this absorbance (abs) or fluorescence (flu) data?:' ,'s');
c = input('Do you want corrected spectra? (y/n) ' ,'s');
figure
for N = 1:i;
if filetype == 'abs'
[fnam, pathnam, filterindex] = uigetfile('*.txt', 'pick your .txt file');
cd(pathnam);
fid = fopen(fnam,'r');
sample = textscan(fid,'%f %f','delimiter', ',', 'headerlines',2);
sample_x = sample{1,1};
sample_y = sample{1,2};
spectrum_x = sample_x;
if c == 'y';
spectrum_y = sample_y-min(sample_y);
else
spectrum_y = sample_y;
end
hold on
if N <= 8
plot(spectrum_x,spectrum_y,color(N));
else
plot(spectrum_x,spectrum_y,color(N:N+1));
end
xlabel('Wavelength (nm)');
if c == 'y';
ylabel('Corrected Absorbance (au)');
else
ylabel('Absorbance (au)');
end
if l == 'y';
Labels{1,N} = input('input label for legend: ','s');
end
else
if filetype == 'flu'
[fnam, pathnam, filterindex] = uigetfile('*.txt', 'pick your .txt file');
cd(pathnam);
fid = fopen(fnam,'r');
sample = textscan(fid,'%f %f','headerlines',4);
sample_x = sample{1,1};
sample_y = sample{1,2};
if c == 'y';
spectrum_y = sample_y-min(sample_y);
else
spectrum_y = sample_y;
end
hold on
if N < 8
plot(sample_x,sample_y,color(N));
else
plot(sample_x,sample_y,color(N:N+1));
end
xlabel('Wavelength (nm)');
if c == 'y';
ylabel('Corrected Fluorescence Intensity (counts/s)');
else
ylabel('Fluorescence Intensity (counts/s)')
end
if l == 'y';
Labels{1,N} = input('input label for legend: ','s');
end
else
break
end
end
if N == i
Title = input('Input title: ','s');
title(Title);
if l == 'y';
legend(Labels);
end
hold off
end
end