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: randsphere.m
    path of file: ./repos/gptoolbox/mesh
    
    the code of the file until where you have to start completion: function [N] = randsphere(n,varargin)
% RANDSPHERE  randomly sample n points on a sphere
%
% N = randsphere(n)
% N = randsphere(n,'ParameterName',ParameterValue)
%
% Inputs:
%   n  number of points
%   Optional:
%     'Method' followed by method type as string {'trig'}:
%        'naive'  a non-uniform sampling
%        'rejection'  uniform sampling by rejection
%        'trig'  uniform sampling using Archimedes theorem
%        'normal-deviation'  uniform sampling by controling deviation
%        'stratified'  sampling by stratification of lat/lon
%        'lloyd'  uniform(?) sampling by lloyd relaxation of previous method
%          (this method does not scale)
% Outputs:
%   N  n by 3 list of sample positions on sphere
%
% Todo: This function is badly named. Should be something like random_dir
%

    
function [N] = randsphere(n,varargin)
% RANDSPHERE  randomly sample n points on a sphere
%
% N = randsphere(n)
% N = randsphere(n,'ParameterName',ParameterValue)
%
% Inputs:
%   n  number of points
%   Optional:
%     'Method' followed by method type as string {'trig'}:
%        'naive'  a non-uniform sampling
%        'rejection'  uniform sampling by rejection
%        'trig'  uniform sampling using Archimedes theorem
%        'normal-deviation'  uniform sampling by controling deviation
%        'stratified'  sampling by stratification of lat/lon
%        'lloyd'  uniform(?) sampling by lloyd relaxation of previous method
%          (this method does not scale)
% Outputs:
%   N  n by 3 list of sample positions on sphere
%
% Todo: This function is badly named. Should be something like random_dir
%
  
  method = 'trig';

  if nargin == 0
    n = 1;
  end