function [Rz,lambda] = stat_Rz_lambda(p)

%% License:
% "This work is licensed under the Creative Commons Attribution 4.0
% International (CC BY 4.0) License. To view a copy of this license, visit:
% http://creativecommons.org/licenses/by/4.0/"

%% please cite 
% --> Kristofer Marsch (2020)
% --> DOI for this data available at https://orcid.org/0000-0002-1857-506X


%% calculating Rz and lamda
% Rz: span of heights, vertical distance between max(y) and min(y)
% lamda: ultimate slope of profile

%% --parameters-- %%
% p: array of profile, first column horizontal values, second column heights
% profile must be de-trended
% profile must have equal point distances, e.g. constant sampling interval

%% calculate Rz and lamda
Rz = max(p(:,2))-min(p(:,2));
L = p(end,1)-p(1,1);
lambda = Rz/L;

