%% Create Pointer Offset from Existing lib.pointer Object
% This example shows how to create a pointer to a subset of a MATLAB vector  X. The new pointer is valid only as long as the original pointer exists.
% Create a pointer to a vector.

X = 1:10;
xp = libpointer('doublePtr',X);
xp.Value

%
% Use the lib.pointer plus operator (+) to create a pointer to the last six elements of X.

xp2 = xp + 4;
xp2.Value

%
% Copyright 2015 The MathWorks, Inc.