function test hold off; step = .1; % step = .05; % step = .01; L = floor (8 * pi / step) + 1; t=[0:step:L * step] + (rand([1,L + 1]) - .5) * step; P=[t;sin(t) + cos(t*5) * 0.1 .* (t > 3.5*pi) .* (.05*t.^1.3)]; % Add noise Noise = 0.0000; % Noise = 0.0005; % Noise = 0.001; % Noise = 0.002; % Noise = 0.005; % Noise = 0.01; P(2,:) = P(2,:) + (rand(1,length(t))-.5) * Noise; % Min improvement in 2*degrees to mark EA = 5 / 180 * pi; curvature (P,4*pi, EA); hold off;