view plotConvergenceFit.m @ 86:3c39dd714fb6

In Curve: Added numerical FD differentiation if derivative is not supplied. Added arc length computation based on the derivative. Added arc length parameterization (but this function is very slow.). In +util: Added fzero_vec.m and integral_vec.m, which call fzero and integral but take vector arguments.
author Martin Almquist <martin.almquist@it.uu.se>
date Sun, 29 Nov 2015 14:28:53 +0100
parents 4fcc4448682f
children 0ef8965dd745
line wrap: on
line source

% Draws a line in a loglog plot with slope `slope` and position `pos`
% and `width` orders of magnitude wide.
%    ex: pos = [1e-1 1e-4]

function hand = plotConvergenceFit(slope, pos, width)
    x0 = pos(1);
    y0 = pos(2);

    x = [x0*10^-(width/2) x0*10^(width/2)];
    y = x.^slope * x0^-slope * y0;

    hand = line(x,y);
    hand.Color = Color.black;
    hand.LineStyle = '--';
    hand.LineWidth = 2;
end