mirror of
https://github.com/eddyem/stm32samples.git
synced 2026-02-28 11:54:30 +03:00
restructuring
This commit is contained in:
13
F0:F030,F042,F072/Socket_fans/knots/getknots.m
Normal file
13
F0:F030,F042,F072/Socket_fans/knots/getknots.m
Normal file
@@ -0,0 +1,13 @@
|
||||
function idx = getknots(X, Y, dYmax)
|
||||
%
|
||||
% idx = getknots(X, Y, dYmax) - calculate piecewise-linear approximation knots for Y(X)
|
||||
% dYmax - maximal deviation
|
||||
%
|
||||
idx = [];
|
||||
I = getnewpt(X, Y, dYmax);
|
||||
if(I > 0)
|
||||
L = getknots(X(1:I), Y(1:I), dYmax);
|
||||
R = I-1 + getknots(X(I:end), Y(I:end), dYmax);
|
||||
idx = [L I R];
|
||||
endif
|
||||
endfunction
|
||||
Reference in New Issue
Block a user