function nc_type = gmt_get_nctype(variable) % GMT_GET_NCTYPE Returns the netcdf type of var % Returns the netcdf type of var % % OUT nc_type string containing the netcdf type % IN var input data whos type will be determined % % Created by Salomon Eliasson % $Id$ str = struct('logical','BYTE','int8','BYTE',... 'int16' ,'SHORT',... 'int32' ,'INT',... 'single','FLOAT',... 'double','DOUBLE',... 'uint8' ,'UBYTE',... 'uint16','USHORT',... 'uint32','UINT',... 'int64' ,'INT64',... 'uint64','UINT64'); if isfield(str,class(variable)) nc_type = str.(class(variable)); else error(sprintf('gmtlab:%s:input',mfilename),... 'Class %s has no corresponding netcdf type',class(variable)) end