Skip to content
Snippets Groups Projects
Commit 83999101 authored by JuanPi Carbajal's avatar JuanPi Carbajal
Browse files

sandbox: friction meas.: update the script for second measurements

parent c7a0ae34
No related branches found
No related tags found
No related merge requests found
fname =@(i)sprintf ("friction2_%d.dat", i);
#for i=1:5
# tmp = load (sprintf ("friction%d", i));
# plot(tmp(:,1), tmp(:,2),'s');
# tmp = load (fname(i));
# plot(tmp(:,1), tmp(:,2),sprintf('s;%d;',i));
# axis tight
# pause
#endfor
pkg load signal
t0 = [25, 8, 13, 15, 8];
# friction1
#t0 = [25, 8, 13, 15, 8];
# friction2
t0 = [12, 13, 7.3, 8, 12];
for i=1:5
tmp = load (sprintf ("friction%d", i));
tmp = load (fname(i));
tf = (tmp(:,1) >= t0(i)) & ~isnan (tmp(:,2));% & tmp(:,2) >= 0.8;
t{i} = tmp(tf,1); t{i} = t{i} - t{i}(1);
w{i} = tmp(tf,2);
......@@ -65,7 +72,7 @@ for i=1:5;
endfor
w_ = vertcat (w_{:});
a_ = vertcat (a_{:});
awm = splinefit(w_,a_,[min(w_) 1 max(w_)], 'order', 1);
awm = splinefit(w_,a_,[min(w_) 1 3 max(w_)], 'order', 1);
T = max(cellfun(@max,t));
Fr = @(t,x) ppval(awm,x);
for i=1:5;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment