📄 plot_stretch_by_distance.m
字号:
function plot_stretch_by_distance(estimate, real, color, ... abs_or_relative , msz)%estimate: format of Nxd: N elements of d runs%real: format of Nx1%estimate = mean(estimate,2); %new here[N inst] = size(estimate);if nargin<6 ignore_inf = 0;endif length(real)==0 dd = estimate; error('no optimal value??')else %n = length(estimate); mask = find(real==Inf); real(mask) = 10000; estimate(mask,:) = 10000; mask = find(real==0); real(mask) = 0.01; mask = find(estimate==0); estimate(mask) = 0.01; %real= real+eye(n); %estimate = estimate + eye(n); rep_real = repmat(real,1, inst); if strcmp(abs_or_relative,'abs') dd = estimate-rep_real; else dd = estimate./rep_real; end dd = dd(:); %dd = mean(sort(dd,1),2);% size(dd)enduniq_real = sort(union(real(:), []));rep_real = rep_real(:);for i = 1:length(uniq_real) idx = find(rep_real==uniq_real(i)); avg_stretch_by_dist(i) = mean(dd(idx)); max_stretch_by_dist(i) = max(dd(idx)); min_stretch_by_dist(i) = min(dd(idx));endplot(uniq_real, avg_stretch_by_dist, color, 'MarkerSize', msz)%plot(uniq_real, max_stretch_by_dist, color)%plot(uniq_real, min_stretch_by_dist, color)% $$$ errorbar(uniq_real, avg_stretch_by_dist, ...% $$$ avg_stretch_by_dist - min_stretch_by_dist,...% $$$ max_stretch_by_dist- avg_stretch_by_dist, ...% $$$ color, 'MarkerSize', 15) %ylim([1 1.2])%xlim([0 300]);%xlim([-1 1]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -