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: HELP_triSurfRayTrace.m
    path of file: ./repos/GIBBON/docs
    
    the code of the file until where you have to start completion: %% triSurfRayTrace
% Below is a demonstration of the features of the |triSurfRayTrace| function

%%
clear; close all; clc;

%% Syntax
% |[P,indIntersect,d,TUV]=triSurfRayTrace(P_origin,Nr,F,V,optionStruct);|

%% Description
% This function performs ray-tracings using the rays or lines defined by Nr
% with origin P_origin. The rays are traced to the surface defined by the
% faces F and the vertices V. An option structure can be added to control
% the toleranc
    
function

%%
clear; close all; clc;

%% Syntax
% |[P,indIntersect,d,TUV]=triSurfRayTrace(P_origin,Nr,F,V,optionStruct);|

%% Description
% This function performs ray-tracings using the rays or lines defined by Nr
% with origin P_origin. The rays are traced to the surface defined by the
% faces F and the vertices V. An option structure can be added to control
% the tolerance level to use to consider intersections on ray/line and on
% triangle.
% 
% DEFAULTS:
% defaultOptionStruct.tolEps = 1e-5; %Tolerance level
% defaultOptionStruct.triSide = 0; %Triangle sides to consider
% defaultOptionStruct.rayType = 'ray'; %Use 'ray' type rather than 'line'
% defaultOptionStruct.exclusionType = 'inclusive'; %Include within tolerance
% defaultOptionStruct.paired=0; 
%
% The output consists of: 
% P            : An nx3 array for the intersection point coordinates
% indIntersect : An nx2 array with indices for rays and faces or the first/second columns respectively. 
% d            : An nx1 array with distances from the ray origin to the intersection point
% TUV          : An nx3 array with the t-parameter, and the barycentric coordinates u and v as columns

%% Examples

%%
% Plot settings
markerSize=40;
fontSize=10;
faceAlpha=0.25;

%%
% Example triangulated surfaces
[F,V]=geoSphere(1,1);

%% Example use for ray tracing a single ray or line to multiple faces
% This example shows non-paired analysis. This means that intersections are
% computed for each ray for all faces. 

p_origin=[0 0 3];%Ray origin
nr=[0 0 -1]; %Ray vector

optionStruct.tolEps        = 1e-6;
optionStruct.triSide       = 0;
optionStruct.rayType       = 'ray';
optionStruct.exclusionType = 'inclusive';
optionStruct.paired        = 0; 

[P,indIntersect,d,TUV]=triSurfRayTrace(p_origin,nr,F,V,optionStruct);

%%
% Visualization

p_end