MATLAB does not know what a c_struct is without loading the library. Load the library first using the code from the example:
if not(libisloaded('shrlibsample'))
  addpath(fullfile(matlabroot,'extern','examples','shrlib'))
  loadlibrary('shrlibsample')
end


