function [outputArg1, outputArg2] = getSampleType(channel_handle)
%function to get type of data (analog, reduced, digital, vector, complex vector)

   sampleTypeData = 0;
   sampleTypeReduced = 0;
   [DMDReader_ErrorCode, channel_handle, sampleTypeData, sampleTypeReduced] = calllib('dmdlib', 'DMDReader_GetSampleType', channel_handle, sampleTypeData, sampleTypeReduced);
   if (DMDReader_ErrorCode ~= 0)
      % get sample type for vector channel
       maxDim = 0;
       [DMDReader_ErrorCode, ~, sampleTypeData, sampleTypeReduced, maxDim] = calllib('dmdlib', 'DMDReader_GetVectorSampleType', channel_handle, sampleTypeData, sampleTypeReduced, maxDim);

       assignin ('base','maxDim', maxDim); 
       % check if channel is vector
       if sampleTypeData == 100 
           outputArg1 = sampleTypeData;
           outputArg2 = sampleTypeReduced;
           return;
       % check if channel is complex vector
       elseif sampleTypeData == 101
           outputArg1 = sampleTypeData;
           outputArg2 = sampleTypeReduced;
           return;
       end
   close(f)
   error(['Error: ', num2str(DMDReader_ErrorCode), ' DMDReader_GetSampleType'])
   end
   
outputArg1 = sampleTypeData;
outputArg2 = sampleTypeReduced;

end

