You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pick_curves.m
    path of file: ./repos/gptoolbox/external/toolbox_fast_marching
    
    the code of the file until where you have to start completion: function sk = pick_curves(mask)

% pick_curves - ask for the user to build a set of curves
%
%   sk = pick_curves(mask);
%
%   mask is a background image (should be in [0,1] approx).
%
%   The user right-click on a set of point which create a curve.
%   Left click stop a curve.

    
function sk = pick_curves(mask)

% pick_curves - ask for the user to build a set of curves
%
%   sk = pick_curves(mask);
%
%   mask is a background image (should be in [0,1] approx).
%
%   The user right-click on a set of point which create a curve.
%   Left click stop a curve.
%   Another left click stop the process.
%
%   Copyright (c) 2007 Gabriel Peyr?


n = size(mask,1);

sk = zeros(n);

b = 1;
while b(end