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: calcPDF.m
    path of file: ./repos/mtex/SO3Fun/@SO3Fun
    
    the code of the file until where you have to start completion: function pdf = calcPDF(SO3F,h,varargin)
% calcPDF computed the PDF corresponding to an ODF
%
% Syntax
%   pdf = calcPDF(SO3F,h)
%   pdf = calcPDF(SO3F,h,'superposition',c)
%   value = calcPDF(SO3F,h,r)
%   ipdf = calcPDF(SO3F,[],r)
%
% Input
%  SO3F - @SO3Fun
%  h   - @Miller / @vector3d crystal directions

    
function pdf = calcPDF(SO3F,h,varargin)
% calcPDF computed the PDF corresponding to an ODF
%
% Syntax
%   pdf = calcPDF(SO3F,h)
%   pdf = calcPDF(SO3F,h,'superposition',c)
%   value = calcPDF(SO3F,h,r)
%   ipdf = calcPDF(SO3F,[],r)
%
% Input
%  SO3F - @SO3Fun
%  h   - @Miller / @vector3d crystal directions
%  r   - @vector3d specimen directions
%
% Output
%  pdf   - pole density function @S2FunHarmonicSym
%  ipdf  - inverse pole density function @S2FunHarmonicSym
%  value - double
%
% Options
%  superposition - calculate superposed pdf
%
% Flags
%  antipodal - include <VectorsAxes.html antipodal symmetry>
%
% See also
% SO3Fun/plotPDF SO3Fun/plotIPDF SO3Fun/calcPoleFigure

% check crystal symmetry
if isa(h,'Miller')
  h = SO3F.CS.ensureCS(h); 
elseif ~isempty(h)
  h = Miller(h,SO3F.CS);
end