-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotFpMsKd.m
46 lines (40 loc) · 1.27 KB
/
plotFpMsKd.m
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
function plotFpMsKd(pedal)
if (~exist('pedal', 'var'))
pedal = 'trial3-ep2.csv';
end
fp_result = 'Kd_FP_sum.xlsx';
Range = 'A1:C34';
[num, ~, raw] = xlsread(fp_result,Range);
seq = raw(2:end,1);
x=num(:, 1);%fp
xE=num(:, 2);% fp errors
y=nan(length(x),1);
yE=nan(length(y),1);
T = readtable(pedal);
seq3 = T.sequence;
kd = T.Kd_estimate; % pedal kd
est = T.error_est_; % pedal estimated error
for i = 1:length(seq)
for j = 1: length(seq3)
if (seq{i}==seq3{j})
y(i)=kd(j);
yE(i)=est(j);
end
end
end
x=x./1000000;
xE=xE./1000000;
y=y./1000000;
yE=yE./1000000;
figure;
errorbar(log10(x), log10(y), yE./(y*log(10)), yE./(y*log(10)), xE./(x*log(10)), xE./(x*log(10)), 'o','MarkerSize',5,'MarkerEdgeColor','black','MarkerFaceColor','black','LineStyle','none', 'Color', [0.5,0.5,0.5],'linewidth', 0.5);
r = corrcoef(log10(x), log10(y));
fprintf('R between PEDAL and FP: %f, over %d points\n', r(1,2), length(x));
[~, mi] = max(abs(log(x) - log(y)));
r = corrcoef(log10(x(setdiff(1:length(x), mi))), log10(y(setdiff(1:length(x), mi))));
fprintf('R between PEDAL and FP: %f, when the worst outlier removed\n', r(1,2));
xlabel('FP log10(Ki or Kd/[M])')
ylabel('PEDAL log10(Kd/[M])')
% xlim([-7.5,-3])
% ylim([-7,-3])
%title('trial3(4096_pep_lib)')