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: default_quadprog_param.m
    path of file: ./repos/gptoolbox/matrix
    
    the code of the file until where you have to start completion: function [param,mosek_exists] = default_quadprog_param()
  % DEFAULT_QUADPROG_PARAM
  % 
  % [param,mosek_exists] = default_quadprog_param()
  %
  % Outputs:
  %   param stuct containing some nice default mosek params
  %   mosek_exists  whether mosek exists

    
function [param,mosek_exists] = default_quadprog_param()
  % DEFAULT_QUADPROG_PARAM
  % 
  % [param,mosek_exists] = default_quadprog_param()
  %
  % Outputs:
  %   param stuct containing some nice default mosek params
  %   mosek_exists  whether mosek exists
  %
  persistent num_threads
  % Tolerance parameter
  % >1e0 NONSOLUTION
  % 1e-1 artifacts in deformation
  % 1e-3 artifacts in isolines
  % 1e-4 seems safe for good looking deformations
  % 1e-8 MOSEK DEFAULT SOLUTION
  % 1e-14 smallest allowed value
  if(exist('mosekopt','file'))

    if isempty(num_threads)
        % always use one core and always leave one core
        num_threads = max(feature('numCores')-1,1);
        if(isunix)
          % Get the real number of cores
          [r,c] = system('sysctl hw.ncpu | awk ''{print $2}''');
          if r==0
            c = str2double(c);
            if ~isnan(c)
              num_threads = max(c-1,1);
            end