-
Notifications
You must be signed in to change notification settings - Fork 1
/
FindForceCurveOnDroplets.m
29 lines (28 loc) · 1.06 KB
/
FindForceCurveOnDroplets.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
function [ForceCurveOnDroplets]=FindForceCurveOnDroplets( Xretrace, Yretrace, NumberOfCurves)
% this script was used to extract the force curve performed on droplet
% this arlgrithm evaluate the slope of the F-Z curve at the end portion,
% and the portion around `90 nm, see the graphic at the root folder
order=1;
for i=1:NumberOfCurves
FitParameterEnd=polyfit(Xretrace{i}(1:8),Yretrace{i}(1:8),1);
if FitParameterEnd(1)>.3
FitParameterMid=polyfit(Xretrace{i}(135:145),Yretrace{i}(135:145),1);
if FitParameterMid(1)>.04
ForceCurveOnDroplets(order)=i;
order=order+1;
end
end
end
% first, mapping to the height image
% [data, scaleUnit, dataTypeDesc] = NSMU.GetForceVolumeImageData(NSMU.METRIC);
% xLabel = NSMU.GetScanSizeLabel();
% Height = flipud(data);
% figure();
% surface(Height);
% colormap('hot');
% colorbar();
% xlabel(xLabel);
% superposition
% figure;
side=sqrt(double(NumberOfCurves));
scatter(mod(ForceCurveOnDroplets,side),fix(ForceCurveOnDroplets/side),50,[0 0 0],'filled');