MATLAB: Do I receive an error when I use LIBPOINTER with MATLAB 7.0 (R14)

lib.pointerlibpointerlibraryloadlibraryMATLABnativeshared

I am using the LOADLIBRARY and LIBPOINTER functions in MATLAB 7.0 (R14) to interact with my shared library directly from MATLAB. When I issue the following sequence of commands:
x = 10;
xp = libpointer('doublePtr', x);
I receive this error:
??? Undefined variable "lib" or class "lib.pointer".
Error in ==> libpointer at 18
ptr=lib.pointer(varargin{:});
I did not receive this error in MATLAB 6.5.1 (R13SP1)

Best Answer

In MATLAB 7.0 (R14) the lib class which provides the LIBPOINTER functionality is loaded dynamically after a successful call to LOADLIBRARY. Therefore, you should load the library with LOADLIBRARY before creating LIBPOINTER structures.
For additional information and an example of the sequence of steps to be used, type the following at the MATLAB command prompt
doc libpointer