Contents

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Make 3D Plot of SECM Image
% Code By Yin Jing
% 10/11/2014
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
clear

Take the average on one scanning area

bg_image1 = importdata('f:/bi_secm.txt');
bg_image2 = importdata('f:/bi_secm.txt');

ki_image1 = importdata('f:/bk_secm.txt');
ki_image2 = importdata('f:/bk_secm.txt');

bg_image(:,1) = bg_image1(:,1);
bg_image(:,2) = bg_image1(:,2);
bg_image(:,3) = (bg_image1(:,3) + bg_image2(:,3)) / 2;

ki_image(:,1) = ki_image1(:,1);
ki_image(:,2) = ki_image1(:,2);
ki_image(:,3) = (ki_image1(:,3) + ki_image2(:,3)) / 2;

Substract the background

[x,y,z] = background_substract(bg_image, ki_image);

Calculate the averaged current on the image

avgCurrent = cal_averagecurrent([x, y, z]);

3D plot

[x, y, z] = reshape_surf(x, y, z);

%subplot(3, 1, 3)
surf(x, y, z,'LineStyle','default');
title('SECM image without background', 'FontSize',16)
colormap default;
axis([min(unique(x)) max(unique(x)) min(unique(y)) max(unique(y))]);
xlabel('X / um','FontSize',16);
ylabel('Y / um','FontSize',16);
zlabel('Z / A','FontSize',16);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% x = bg_image(:,1);
% y = bg_image(:,2);
% z = bg_image(:,3);
%
% uniq_x = size(unique(x));
% size_x = size(x);
% num_x = size_x(1) / uniq_x(1);
%
% r_x = reshape(x,[uniq_x(1), num_x]);
% r_y = reshape(y,[uniq_x(1), num_x]);
% r_z = reshape(z,[uniq_x(1), num_x]);
%
% %subplot(3, 1, 1)
% surf(r_x, r_y, r_z,'LineStyle','default');
% title('SECM background image on clean disk')
% colormap default;
% axis([min(unique(x)) max(unique(x)) min(unique(y)) max(unique(y))]);
% xlabel('X / um');
% ylabel('Y / um');
% zlabel('Z / A');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% x = ki_image(:,1);
% y = ki_image(:,2);
% z = ki_image(:,3);
%
% uniq_x = size(unique(x));
% size_x = size(x);
% num_x = size_x(1) / uniq_x(1);
%
% r_x = reshape(x,[uniq_x(1), num_x]);
% r_y = reshape(y,[uniq_x(1), num_x]);
% r_z = reshape(z,[uniq_x(1), num_x]);
%
% %subplot(3, 1, 2)
% surf(r_x, r_y, r_z,'LineStyle','default');
% title('SECM image on clean disk w/ -0.4V')
% colormap default;
% axis([min(unique(x)) max(unique(x)) min(unique(y)) max(unique(y))]);
% xlabel('X / um');
% ylabel('Y / um');
% zlabel('Z / A');