-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added fitting procedure for load over stiffness squared
- Loading branch information
unknown
committed
Sep 24, 2015
1 parent
d1eafd6
commit cbfd19d
Showing
5 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
%% Copyright 2014 MERCIER David | ||
function model_loadOverstiffnessSquared | ||
%% Function used to analyze load over stiffness squared | ||
gui = guidata(gcf); | ||
|
||
%% Fit of the (load over stiffness squared)-displacement curve | ||
if gui.variables.val2 == 2 | ||
% See also 'fitlm' function in Matlab for linear regression | ||
polyCoeff = 1; | ||
[Pfit Sfit] = polyfit(gui.data.h, (gui.data.P ./ (gui.data.S.^2)), polyCoeff); | ||
gui.results.LS2_fit = Pfit(1).*gui.data.h + Pfit(2); % in mN/nm | ||
gui.results.linear_fit = Pfit; | ||
gui.results.residual = gui.results.LS2_fit - (gui.data.P ./ (gui.data.S.^2)); | ||
gui.results.rSquare = r_square((gui.data.P ./ (gui.data.S.^2)), ... | ||
gui.results.LS2_fit); | ||
else | ||
gui.results.linear_fit = [0 0 0]; | ||
gui.results.LS2_fit = 0; | ||
gui.results.residual = 0; | ||
gui.results.rSquare = 0; | ||
end | ||
|
||
guidata(gcf, gui); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters